Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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)


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.


Yea it was very weird. I think most people realized that his way wasn't the right way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: