this post was submitted on 14 May 2025
56 points (100.0% liked)
Linux
56009 readers
1114 users here now
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.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I'd write
for the same reason I'd write
or in another language
Because it's all part of the same statement and having a single line with just
do
or{
seems silly and implies (to me) that the lines aren't related.I feel exactly the opposite.
while true do stuff done
looks much more clean to me.
It just looks weird to me to stick a semicolon into the middle of a line when a compound command isn't actually needed.
So you'd rather it all be on one line? I'd only do that if it's a very simple command, otherwise you're just making the code harder to read.
No the opposite. I think more shorter lines makes it easier to read than fewer longer lines.
isn't exactly harder to read than
though, is it? And going back to my original point, I don't like
while true
being on its own as to me it looks like it's meant to be a separate statement rather than part of thedo/done
block.Its a personal style choice.
With a blank line before the 'while' and another after the 'done' its a nice little easy to identify block. I don't know how the 'while' would look like its not a part of that block.
A midline semicolon just looks ugly to me so I don't do it unless it is the only way to make a statement work.