Gren format does not remove unnecessary parens
The new gren-format tool does not remove unnecessary parentheses. First of all, this is very nicely documented within a list of settled decisions. This decision might seem surprising, but I think it’s right. Why would you put unnecessary parentheses in, unless you thought they increased clarity? In my first year of a computer science degree (last century), I recall an exam which included questions about operator precedence in C programs. I recall thinking this was a dumb exam question that tested recall and nothing important. As young and foolish as I was then I think I got that assessment right. I’m still unsure if I could accurately state the operator precedence rules in most of the languages I use. Firstly, I typically do not write complicated mathematical expressions without giving names to intermediate results. Secondly, if I’m at all unsure I just put the parentheses in and, there is no problem. I often put the parentheses in even if I am sure. I know that * binds more tightly than +, but still I don’t see the problem in writing: ...