• Carlo Romagnano (5/2/2009)


    I agreed with you. I do not like unneeded parenthesis.

    I agree too, about not liking unnecessary parentheses. But I can hazard a guess as to why people do it: perhaps they first learned a language where parentheses around conditionals were mandatory (if X then Y not allowed, it has to be of (X) then Y) and/or they used languages where words like "and" and "or" were heavily overloaded ( X = a or b might mean either X = (a or b) or (X = a) or b depending on the types of X, a and b, and could actually be ambiguous for some type combinations) amnd got into the habit os using brackets all the time.

    Different point: this question points up one of the stupidities of SQL: () represents a set of columns/values, except in the single case where is the empty list, in which case using it to represent a set will give you a syntax error. That's the sort of inconsistency that really irritates me (as a former language designer) - it makes the syntax slightly harder to analyse so that writing a compiler/tokenizer/interpreter is harder; and it makes the language slightly more difficult to learn; and (this is the crunch point) it sometimes makes the language quite a lot harder to generate dynamically.

    Tom