Hacker News new | ask | show | jobs
by hhyndman 1406 days ago
APL was the first language I learned in school and I was thrown by the precedence of the mathematical operators, but once the other operators were put in play, it was an incredibly simple rule -- and rarely did I or other APL developers have bugs relating to order of operation.

I then moved to C++ and was gobsmacked the the precedence rules and was forced to use parentheses to get things right. I have seen hundreds of bugs produced by programmers that tried to be clever and avoid parens relying on their faulty memory of the precedence priorities.

Just look at the C++ Operator Precedence table listed at the following URL. It's wild!

https://en.cppreference.com/w/cpp/language/operator_preceden...

1 comments

An interesting article relating to "operator precedence is broken". https://www.foonathan.net/2017/07/operator-precedence/