Hacker News new | ask | show | jobs
by lfuller 4398 days ago
I'd argue the second is clearer in many cases. Readability trumps conciseness any day.
2 comments

I 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.

Really? In which cases would the previous example be clearer than

    return expression;
What readability does the verbosity add?