News for hackers. Stuff that matters.
Re:A Modern JavaScript Tutorial by dagw on Tuesday December 08, 2020 @06:25AM (#25343968)
Reminds me of a CS teacher for our intro Haskell course at university who would dock points for unnecessary use of parentheses, since he considered that it showed we didn't understand order of operations or how our program was parsed.
Re:A Modern JavaScript Tutorial by heja2009 on Tuesday December 08, 2020 @07:40AM (#25344386)
The programming language Occam, in its time the primary language to program Transputers, did not have operator precedence, so you had to use parentheses for anything. It was a huge pain, but probably still better than avoiding the edge cases of what you describe...

https://en.wikipedia.org/wiki/Occam_(programming_language)

Re:A Modern JavaScript Tutorial by Timpy on Tuesday December 08, 2020 @06:57AM (#25344142)
That sounds like a bad professor. It doesn't cost anything to add parenthesis for clarity. I enjoy well written code but we're not writing literature here, it's okay to be explicit.
Re:A Modern JavaScript Tutorial by dagw on Tuesday December 08, 2020 @07:19AM (#25344251)
Yea it was very weird. I think most people realized that his way wasn't the right way.