Hacker News new | ask | show | jobs
by zck 4421 days ago
There's a common complaint in this thread that is basically "just write your code better, then it'll be readable." There's also a common praise of Haskell that says that its type system eliminates entire classes of errors. It's not accepted by people who use Haskell that "if you use another language and just write your code better, you don't need a type system."

Having to explicitly indicate the precedence of operators -- as in Lisp's prefix notation -- completely eliminates precedence errors, both in writing and in reading. This is true even though "well-written"^1 code using implicit infix notation is readable.

[1] Note also that the level of implicit precedence that you're comfortable with might be different from mine.

1 comments

The original infix operators and their precedences were natural to reason about...

  * /
  + -
  = !=
  &&
  ||
Of course you can always use an infix macro in Clojure, e.g. http://data-sorcery.org/2010/05/14/infix-math/