Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That bash code he posted as ‘unreadable’ is perfectly clear to me, and I don’t even know anything about the jira command line interface.

I think the real problem here is people always have preferred tools for jobs. The author obviously spends more time with JavaScript and finds that to be clearer and easier to write. I spend more time with bash and for me, it’s very clear. It doesn’t make it ‘inscrutable’



You have to admit the bash code is less readable to someone who hasn't used those particular CLI arguments or flags in a while (or ever), as compared to someone trying to read the JavaScript version without knowing much about JS or the library that the code used.

You might argue that this is an acceptable trade-off to make to in order to gain terseness and ease of typing. But this is different than saying it's just matter of tool familiarity.


Yes, but how much less?

I find the bit of bootstrapping I need to make sense of shorter length operators and options pays off when writing and or reading later.


I have worked considerably more with bash than javascript and I found the JavaScript clear and have no idea what the bash script does.


I think you're missing part of the author's point. In the bash script, each command and flag being used does something and what they do is not obvious to anyone who is not well-versed in those commands and flags.

The JS example is closer to english or pseudo-code, which makes it inherently more readable. It is not as terse, but it is also not esoteric like the bash script. Someone who doesn't know bash or JS will probably be able to understand the JS version more quickly.


"perfectly readable to me" is not a good response to complaints about readability. You aren't an accurate gauge of "readable to most".


I have no idea why you're being downvoted -- the person who wrote the code shouldn't be deciding how readable it is, as they're clearly biased.

I had to deal with this the other day. I approved a PR, with a comment that 5-7 lines of the logic were unreadable and convoluted. I left a more concise way to write the code as a suggestion.

When I saw the merged code in master a few days later, I noticed that the convoluted logic was still there. When I asked them about it, they just said "well, to me, it's readable, so I decided to keep it".

¯\_(ツ)_/¯

Lesson for me: Don't approve PRs if I don't feel good about the quality of the code being committed.

Lesson for my coworker: If someone strongly disagrees with you, get a second opinion, don't just merge your code into master.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: