Settings

Theme

Optional Parentheses: You're Doing it Wrong

blog.mojotech.com

11 points by dberube 14 years ago · 2 comments

Reader

jhrobert 14 years ago

F(x) versus I p -- functional versus imperative, idempotent versus side effect... that's an interesting convention.

I believe the mess with optional parentheses is mainly due to the left/righ associative rule. i.e. I have difficulties to properly group subexpressions.

My style: don't assume reader knows about associativity rules so much, prefer explicit parentheses when ambiguities about interpretation is solved by these associativity rules.

For language designers: maybe parentheses should be mandatory when sufficiently nested?

unobtainium 14 years ago

:)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection