3 ms·
Encouraging coworkers to learn the proper syntax seems a better choice than hiding it with personally chosen abstractions (albeit more readable).
by datashaman 12y ago
Encouraging coworkers to learn the proper syntax seems a better choice than hiding it with personally chosen abstractions (albeit more readable).
- girvo 12y agoI don't disagree, but in some contexts that trade off is worth it, in my opinion.
- myg204 12y agoYeah, definitely better to keep it idiomatic. Also: $ test -f "$file" is pretty clear I think.
- lukeschlather 12y agoThe "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.
- datashaman 12y agoThe correct answer. ^^^
- klibertp 12y agoYou 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.