DEV Community

Cover image for Code Smell 156 - Implicit Else

Code Smell 156 - Implicit Else

Maxi Contieri on August 06, 2022

We learn if/else on our first programming day. Then we forget the else TL;DR: Be explicit. Even with Else. Problems Readability Cog...
Collapse
 
jonrandy profile image
Jon Randy 🎖️

The functionality of the two code samples is different

Collapse
 
mcsee profile image
Maxi Contieri

Hi

It is not a "safe refactor"
And, as long as I can see. the two possitive cases are dealt in the same way

Collapse
 
bwca profile image
Volodymyr Yepishev

But that's the bouncer pattern, no? Lot's of devs prefer it over else 🙃