News for hackers. Stuff that matters.
Re:Common shell script mistakes (2008) by pwd_mkdb on Saturday June 04, 2016 @02:00AM (#11835146)
concision gets me less code to read. that's how i define "readability". but if forum commments are any indication, i know my preferences do not follow the norm.

most programmers seems to prefer verbosity.

however in my case verbosity slows me down.

Re:Common shell script mistakes (2008) by coldtea on Saturday June 04, 2016 @07:05AM (#11835883)
>concision gets me less code to read. that's how i define "readability".

That's a bad definition. Readability should be: "code easier to read", not just "less code to read" -- since less is not always easier and can even be much harder.

Case in point: the J language.

Or "magic" constructs that do too much under the scenes and don't let you immediately understand what a part of code is doing.

Re:Common shell script mistakes (2008) by wodenokoto on Saturday June 04, 2016 @05:36AM (#11835678)
By that logic you find minified javascript easier to read too.
Re:Common shell script mistakes (2008) by nikita2206 on Saturday June 04, 2016 @06:27AM (#11835790)
This is not @pwd_mkdb's logic though, it's you who brought this to the extreme.
Re:Common shell script mistakes (2008) by coldtea on Saturday June 04, 2016 @07:06AM (#11835886)
Not really. @pwd_mkdb said he defines readability as "less code to read".

If that's the only criterion, then the parent just followed the logic. Or let's put it another way, if the definition of readability can't survive taking it to the extreme, it is flawed.

Re:Common shell script mistakes (2008) by cgriswald on Saturday June 04, 2016 @11:36AM (#11836675)
> If that's the only criterion, then the parent just followed the logic.

wodenokoto offered up some reductio ad absurdum and you are calling it logic.

It was not the only criterion. It was the only criterion that was explicit. There are implied criterion and most of us understand what pwd_mkdb means even if we don't necessarily agree with him.

Re:Common shell script mistakes (2008) by coldtea on Saturday June 04, 2016 @12:42PM (#11836928)
>It was the only criterion that was explicit.

Well, even in itself, it is wrong.

It's not just that other criteria apply too -- it's that it alone needs several caveats, as succinctness is quite orthogonal to readability (e.g. sometimes even needless boilerplate syntax that the compiler could infer by itself, make for better readability when present).

Re:Common shell script mistakes (2008) by cgriswald on Sunday June 05, 2016 @01:41AM (#11839787)
> Well, even in itself, it is wrong.

I am not in disagreement with you about whether it is wrong, I am in disagreement with you about why it is wrong.

The counter argument was that Y is wrong and X is Y, therefore X is wrong. While this is a valid argument, it is not sound, because X is not Y.

> ... succinctness is quite orthogonal to readability ...

There is a relationship between succinctness and readability. The relationship is definitely not directly proportional as the pwd_mkdb's post could be read to imply, but to say there is no relationship between the two is flatly absurd.

Re:Common shell script mistakes (2008) by teamhappy on Saturday June 04, 2016 @05:09AM (#11835620)
I define readability the same way the Linux kernel style guide does: Avoid tricky expressions.
Re:Common shell script mistakes (2008) by eximius on Saturday June 04, 2016 @03:07AM (#11835315)
Something very 'readable' is something read and understood easily. Python is considered very readable, for example. I would not consider Python verbose. C++ Template programming is verbose and it is not particularly pleasant to read. At the same, APL or J or something can be very concise and is largely unreadable to most. Notice how Python, which is considered by most to be readable, is somewhere in between.
Re:Common shell script mistakes (2008) by vacri on Saturday June 04, 2016 @03:41AM (#11835403)
If the command is as short as "echo 'found'", then that one-liner is easier, but if it's a nice, lengthy command, I find the 'full' version easier to read.
Re:Common shell script mistakes (2008) by mikeash on Saturday June 04, 2016 @12:56PM (#11836976)
Is ts cmmt esr t rd?