|
|
|
|
|
by reacweb
3845 days ago
|
|
Very interesting article and I agree with most of the points. One point I strongly disagree is what is called "Code clarity" where the author replaces conditional expressions (https://www.gnu.org/software/bash/manual/html_node/Bash-Cond...) by function calls. I agree that the function call introduces a better name. The problem is that this name is specific to the author of the script. It replaces a reusable tricky knowledge of the language by a simple knowledge of the author usages. If we take into account the increased verbosity, increased typing, increased number of lines, there is a clear loss in using these functions. For me, adding a comment would be far enough and far less annoying. |
|
It'd be like defining an "and" function and writing
because "&&" is too confusing. It's just syntax. Learn it.And on the subject of &&, it's interesting that in his example about clarity he chooses to use short-circuit and for brevity instead of the more readable if block.