Re:Avoid Else, Return Early (2013)
by timoxley on Monday March 26, 2018 @12:41PM
(#16680203)
It depends. Short, dense code can make the code more difficult to understand/change later, while overly bloated code can have the same effect.
I often find inelegant, yet straightforward solutions are generally better options than dense, mathematically pure solutions, simply because inelegant code usually relies on fewer assumptions. Noting that code rarely/never evolves the way we expect it to, apply Occam's razor and strike a balance.
I often find inelegant, yet straightforward solutions are generally better options than dense, mathematically pure solutions, simply because inelegant code usually relies on fewer assumptions. Noting that code rarely/never evolves the way we expect it to, apply Occam's razor and strike a balance.