Sorry but it's ugly only because it's wrong (there should have been additional spaces before and after square brackets) ;)
The BASH is powerful and its syntax allows to write easy to read code. It just needs some rules to follow. For instance, there can be found a quite good Shell Style Guide from Google
In this particular example, it could be written even simpler
That's the funny thing about these questions (and variations of them can be found in developer forums going back to the early 80's and usenet groups) they are highly subjective.
This should not be surprising as language to large degree encapsulates methods of thinking and psychologists and linguists will tell you quickly that there are vastly many different ways of thinking.
The fluidity of spoken languages ability to relay information comes not from their terseness it comes from their interpretability.
Programming languages are syntactically terse means of conveying information about how to shift bits in low level computer memory cores which in their abstractions from that low level task must necessarily replicate the possible interpretability of the syntax and that will vary with the mode of thinking of the reader. It's a paradox of information transfer between beings with vastly different ways of thinking about the particular ingredients of language revealing itself.
To me, a person who prefers syntax that is explicit over implicit the first version looks more interpretable than the second (my main criteria for this are two fold, a) my personal preference and b) how I think most other engineers would think about it and in particular to ensure that as many as possible would have as little effort as possible in capturing the meaning of the code )
Everything beyond that is subjective bickering....
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorry but it's ugly only because it's wrong (there should have been additional spaces before and after square brackets) ;)
The BASH is powerful and its syntax allows to write easy to read code. It just needs some rules to follow. For instance, there can be found a quite good Shell Style Guide from Google
In this particular example, it could be written even simpler
That is going to be very helpful! Thank you.
that is even harder to read
That's the funny thing about these questions (and variations of them can be found in developer forums going back to the early 80's and usenet groups) they are highly subjective.
This should not be surprising as language to large degree encapsulates methods of thinking and psychologists and linguists will tell you quickly that there are vastly many different ways of thinking.
The fluidity of spoken languages ability to relay information comes not from their terseness it comes from their interpretability.
Programming languages are syntactically terse means of conveying information about how to shift bits in low level computer memory cores which in their abstractions from that low level task must necessarily replicate the possible interpretability of the syntax and that will vary with the mode of thinking of the reader. It's a paradox of information transfer between beings with vastly different ways of thinking about the particular ingredients of language revealing itself.
To me, a person who prefers syntax that is explicit over implicit the first version looks more interpretable than the second (my main criteria for this are two fold, a) my personal preference and b) how I think most other engineers would think about it and in particular to ensure that as many as possible would have as little effort as possible in capturing the meaning of the code )
Everything beyond that is subjective bickering....