DEV Community

loading...

Discussion on: Write better code and be a better programmer by NEVER USING ELSE statements

Collapse
jcoelho profile image
José Coelho

Interesting point! I do try to avoid else statements but only to keep my code short.
I think the word NEVER is too strong, sometimes ‘else’ does help readability.

Inverting the if statements is a good technique but most of the time it hurts readability, you need to pause and adjust your thought to the negative statement.

Anyways good article, great spark for discussion