DEV Community

Discussion on: Code Smell 145 - Short Circuit Hack

Collapse
 
omarbenmegdoul profile image
Omar Benmegdoul • Edited

Why is this a problem specifically before a side-effect?

Something like myFunc?.() will force people to pause. On the other hand short-circuits are a common pattern when setting default values or optionally rendering React components. People are used to reading them in other contexts, often with function calls on the right, so why do they become less readable in this one?