The real criminal here is declaring a variable that can be both boolean
and null
. That's like giving your function three possible states of existence when two would suffice! The triple equals comparison cascade is just the accomplice to this type-safety felony. TypeScript developers are screaming internally right now. The proper way? An enum or a proper nullable boolean with explicit handling. This code is basically begging for a runtime exception to break into your production environment at 2 AM.
True Crime: Type Safety Edition
2 months ago
235,110 views
0 shares

typescript-memes, javascript-memes, boolean-memes, null-memes, type-safety-memes | ProgrammerHumor.io
More Like This
Somebody check on python ๐
1 year ago
72.9K views
0 shares

The Paradox Of Unreachable Code
6 months ago
160.8K views
0 shares

What's The Point
3 months ago
185.3K views
0 shares

Cobol for Your Monies
4 years ago
121.7K views
0 shares

If Condition Rules In My Org
7 months ago
187.0K views
0 shares

My Friend Told Me She Loves TypeScript
5 months ago
172.0K views
0 shares

Loading more content...