Re:CoffeeScript: less typing, bad readability
by bjourne on Monday September 17, 2012 @04:09PM
(#4534601)
But then you have to think everytime whether you should put parantheses there or not. Is the code readable without parantheses? Should I put them there in case someone reads the code in a year and doesn't know about the problem domain ... ? It is not much, but it is extra cognitive load that is wasted.
It's akin to programming C and everytime you write a function, if statement or for loop you have to ponder whether it looks best to put the opening brace below the line or at the end of it. I hate reading code with an inconsistent brace placement style like that.
The OP had a fine example of "doing it wrong", with the nested inner function call without parentheses. While technically valid, it's bad code because it's difficult to read, even for someone accustomed to optional parentheses. Such a construct is "clever" when it shouldn't be.