News for hackers. Stuff that matters.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by User23 on Friday January 05, 2024 @07:00PM (#38886752)
You’re in good company[1]:

  Do not introduce priority rules that destroy symmetry. I remember how much more pleasant the predicate calculus became to work with after we had decided to give con- and disjunction the same binding power and thus to consider p ∧ q ∨ r an ill-formed formula.
[1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD13xx/E...
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by thomasahle on Friday January 05, 2024 @07:16PM (#38886876)
This article is a joy to read.
Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by Terr_ on Saturday January 06, 2024 @12:54AM (#38888829)
> We don’t want to baffle or puzzle our readers, in particular it should be clear what has to be done to check our argument and it should be possible to do so without pencil and paper. This dictates small, explicit steps.

I feel this justifies why I sometimes write code with lots of temporary variables on their own lines: It's a way to break down the problem, to name each thing (especially when it's not a simple method-call to a correctly-named method) and it also makes it easier to verify the behavior with the average line-by-line debugger or line-by-line debugging easier.

In many cases, such temporary local variables have no negative performance impact, being optimized away.

Re:Dennis Ritchie on the priorities of && || vs. == etc. (1982) by lifthrasiir on Saturday January 06, 2024 @03:40AM (#38889701)
It should be noted that this is not same to using a default order (typically, but not necessarily, left-to-right) in such case. Some languages use a term "non-associative" instead.