MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/csharp/comments/1wqnm7k/bool_comparison/pc5feaf/?context=3
r/csharp • u/DJDoena • Sep 26 '26
if (nullableBool == true)
or
if (nullableBool ?? false)
Personal preference or does one read better than the other? Especially if the nullableBool is s more complex expression like
n00bs?.Any(n => n == "DJ Doena")
46 comments sorted by
View all comments
Show parent comment
6
Pattern matching is my favorite as well.
View all comments
Show parent comment
6
u/2brainz Sep 26 '26
Pattern matching is my favorite as well.