|
|
|
|
|
by kccqzy
350 days ago
|
|
Having fewer parentheses is not a win, it makes more things implicit and forces everyone to remember operator precedence. In my opinion operator precedence is never worth remembering other than plus minus multiply and divide. I find heavily parenthesized expressions easy to read, just because I tend to break them into multiple lines and the indentation serves as a guide. Don't put too many of them on a single line. |
|
As a result, you just don't think about precedence when reading code. If you assume the code type checked correctly, you know that it all just makes sense. You don't need to create a parse tree. You just trust.
(Actually, this is the huge advantage of Haskell in most every case. You don't need to understand everything. You just trust that it does what makes sense, and you're right. The compiler enforces it.)