Β© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Maxi Contieri
Software Engineer
TL;DR: Avoid checking for boolean expressions and returning an explicit boolean. Problems Declarativeness Ninja Code Readability Arrow Code Solutions Return a boolean business formula value. Context When dealing with boolean formulas, it is ...
Nate Sire
Coding in C++ Since Eight, Be Great
I often use object literals in place of if/else or switch statements. JS is nice about that.
That's ok if it brings more declarativeness
But switches violate open closed principle so they are yet another code smell
Miki Szeles
Everything related to test automation
Thanks Maxi for this great writing. I totally agree with you. I very often introduce methods additional local variables just to make my code more understandable. π
This case might be (or may not) be another smell.
Do you have a code snippet ?
No I do not have a code snipet, but introducing a variable for betternunderstandg is a widely accepted method in clean code. ππMaxi Contieri
Nate Sire
Coding in C++ Since Eight, Be Great
I often use object literals in place of if/else or switch statements. JS is nice about that.