News for hackers. Stuff that matters.
Re:Clear is better than clever [pdf] by a1369209993 on Monday May 06, 2019 @09:21PM (#19845575)
I think part of the problem is that it'sn't visually obvious that ? and especially : are lower precedence than < and >. I suspect that most of the people with genuine objections would feel better about:

  a<b ? -1 : a>b ? +1 : 0
  # or maybe
  a < b ?? -1 !! a > b ?? +1 !! 0  # perl6 style
  # or
  a < b then -1 else a > b then +1 else 0
not for verbosity vs succinctness but for the mnemonic that visually-smaller operators bind more tightly.

There are no comments on this comment yet.