4 ms·
Because the HN crowd likes learning new things: if `enabled` is a nullable boolean in C# (i.e. has type `bool?`) then this check must indeed be written this way
by kqr 3y ago
Because the HN crowd likes learning new things: if `enabled` is a nullable boolean in C# (i.e. has type `bool?`) then this check must indeed be written this way, to avoid confusing null with false.
- jpnc 3y agoI thought OP meant to imply that the readability could use some tweaking. You have 'disable', 'enabled' and 'False' used in the same expression so it requires some (more) thinking while reading it and trying to decipher what it's trying to do.
- kqr 3y agoThat is a more fundamental and better criticism that I'm embarrassed I overlooked.