5 ms·
I'd argue the second is clearer in many cases. Readability trumps conciseness any day.
by lfuller 12y ago
I'd argue the second is clearer in many cases. Readability trumps conciseness any day.
- the_af 12y agoReally? In which cases would the previous example be clearer than return expression; What readability does the verbosity add?
- MaulingMonkey 12y agoI agree that readability trumps shortness of code. I want not for APL nor code run through a javascript minifier. But the branch and explicit boolean comparison are additional structural complexity (not just "verbosity") and invariably harms readability to me. Care give a poster child example for where it helps readability? Unless it's unclear <expression> results in a boolean - a problem better solved through better naming - code like this forces me to perform the equivalent simplification in my head to understand and reason about the code, a process fraught with error and distraction from my actual task.