3 ms·
> if (disableCommentsRanking.enabled == False) This could use some light-touch code reviewing
by OtherShrezzing 3y ago
> if (disableCommentsRanking.enabled == False)
This could use some light-touch code reviewing
- deleted 3y ago[deleted]
- dvhh 3y agoSome could argue it would be for illustration purpose, and not actual production code
- kqr 3y agoBecause 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.
- bmacho 3y agoIt looks funny, but I think it's actually good, and arguably the best possible form of it.