this post was submitted on 21 Nov 2023
413 points (96.6% liked)

Programmer Humor

32479 readers
234 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 9 points 1 year ago (6 children)

If you're in a language that supports it, please don't use if (false) use if ($disallowAllUsers = false && $whateverTheRealConditionIs)

[โ€“] [email protected] 1 points 1 year ago

The assignment syntax is too close to comparison, which is what is more typical in that position. I would recommend

const bool _isFeatureEnabled = false;
if (_isFeatureEnabled && ...)

if not a proper feature flag (or just remove the code).

load more comments (5 replies)