Skip to main content

Timeline for Make a big deal out of == true?

Current License: CC BY-SA 2.5

10 events
when toggle format what by license comment
Oct 29, 2010 at 8:24 comment added Carra Simple, don't use them.
Oct 19, 2010 at 15:04 comment added Wonko the Sane I was hoping someone would mention this - I was suprised I had to scroll as far as I did.
Oct 19, 2010 at 11:00 history made wiki Post Made Community Wiki
Oct 19, 2010 at 5:47 comment added skolima bool? isValid = null; if (isValid ?? false) ;
Oct 19, 2010 at 4:48 comment added Jarrod Dixon This is my pet peeve with nullable bools :)
Oct 19, 2010 at 3:37 comment added johnc @Ludovic: granted
Oct 19, 2010 at 3:36 comment added Ludovic Chabant @johnc: "if (MyFlag.Value)" may not really do what you want it to as it can throw an exception if MyFlag is null (which you can test by checking MyFlag.HasValue).
Oct 19, 2010 at 2:30 comment added zneak Not all languages have nullable bools, and many of those that do will accept your second construct.
Oct 19, 2010 at 2:05 comment added johnc if (MyFlag.Value)
Oct 19, 2010 at 1:20 history answered Steve Wellens CC BY-SA 2.5