3 ms·
I've seen plenty of if(!(var != true) == false) and the like --- some people just seem to not really understand the concept of booleans.
by userbinator 7y ago
I've seen plenty of if(!(var != true) == false) and the like --- some people just seem to not really understand the concept of booleans.
- Izkata 7y agoIt often goes much further than that. I was a teacher's assistant in the intro-to-programming courses in college for 3 years, and eventually realized what students were seeing. Now, with some new hires, I'm seeing the same thing: They think the expression is "if (.. == ..) { .. }" Not "if (..) { .. }" The simple explanation of what boolean expressions are, and that any boolean expression can go in those parens - and that it's the same thing as storing the result to a variable and then using that variable - is like a lightbulb suddenly blinks in their head.