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

Encouraging coworkers to learn the proper syntax seems a better choice than hiding it with personally chosen abstractions (albeit more readable).


I don't disagree, but in some contexts that trade off is worth it, in my opinion.


You should strive for better readability for intended audience in every single program you write. It's like writing prose, really. It's ok to write "notes to self" with words shortened to single letters and strange symbols all around the place. It's not ok to do the same in a report from a meeting.

You should always remember who you're writing for and write accordingly. Hint: you almost never write for the computer.


Yeah, definitely better to keep it idiomatic. Also:

$ test -f "$file"

is pretty clear I think.


The "proper" syntax is dumb. I've never considered writing functions to get around it, but seeing this makes me want to contribute some builtins to bash.


The correct answer. ^^^




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

Search: