154
Happy with my bash progress!
(lemmy.ml)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
If you want to share your script with others, I think it's a good idea to make it as easy to read as possible.
If you're just keeping it for yourself, that's fine. But if you're sharing it with me, the more readable it is, the easier I'll be able to understand what you're trying to do and how you're solving the problem. This will make it easier for us to discuss ideas and improvements together. To be honest, one-liners can be a bit confusing because they can do multiple things at once. Breaking things down into individual steps makes it easier for me to follow along and for you to understand why you made certain decisions.
Plus, it's a good habit to get into for your own future reference - you'll be able to look back and understand your thought process more easily.
As the famous saying from SICP goes:
Agree. Make it as easy to read as possible. I learned this particularly after I had written a script that had a lot of nesting. It worked initially, but not for long and when I went back to debug I was like, "What the fuck was I thinking here?"
I ended up completely rewriting it to minimize the nesting and make it much more efficient and readable