DEV Community

Discussion on: Question: Is this a terrible idea?

Collapse
 
pigozzifr profile image
Francesco Pigozzi

Just like you said: positive logic requires less cognitive load

For that reason, checking for a negative logic first and quit if true should be safer, more concise and readable than nesting two different logic inside an if/else statement