News for hackers. Stuff that matters.
Re:Anti-If: The missing patterns (2016) by tigershark on Wednesday June 27, 2018 @08:25AM (#17407556)
If someone doesn’t have a basic grasp of Boolean logic then maybe programming is not the right choice..
Re:Anti-If: The missing patterns (2016) by krapp on Wednesday June 27, 2018 @07:24PM (#17412762)
Doesn't matter. Unless one option leads the compiler to generate better code than the other, it's a matter of aesthetics, not correctness. And since you don't even need to be a programmer to understand what the first one means, it's still easier to read.
Re:Anti-If: The missing patterns (2016) by moomin on Thursday June 28, 2018 @09:22AM (#17416612)
An observation that comes from studying foreign languages: you learn “and”, “or” and “not” a long time before “if”.
Re:Anti-If: The missing patterns (2016) by HolyHaddock on Wednesday June 27, 2018 @10:28AM (#17408378)
Earnestly: Yes. But there may well be programming tasks or jobs that they are suited to, for which no understanding of boolean logic will make no difference on a day to day basis.