News for hackers. Stuff that matters.
Re:Anti-If: The missing patterns (2016) by krapp on Wednesday June 27, 2018 @06:33AM (#17407094)
The former can be understood by anyone with a basic grasp of English grammar, while the latter requires understanding the Boolean operator. So yes, the former is more readable.
Re:Anti-If: The missing patterns (2016) by ummonk on Wednesday June 27, 2018 @11:01AM (#17408659)
Borrowing the variable examples from another comment, do you believe that the former is easier to understand for someone who knows English grammar than the latter? (I'm using Python syntax since we're going for English-like readability and added parantheses to the boolean operation to indicate order of operations for the liberal arts major that we've decided is the target audience of this code):

  if isAdmin:
    return false
  if not isActive:
    return false
  return true
vs

  return (not isAdmin) and isActive
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.