Comment by skocznymroczny

4 years ago

he meant making the (a) part optional to make "if a" instead. parenthesis are (), {} are braces :)

One of the few times I get to remember that English is only my second language. Can't really think of a reason for not dropping them unless there is a weird corner case in the existing grammar.

  • If you dropped the parentheses around the condition, I think you’d have to make the braces around the body mandatory.

    Many (most?) C style guides make the braces mandatory, but it’d be a big step to actually change the language syntax that way. Tons of existing code would need to be updated. .. although I guess that could be automated!

    • You could probably do an either or thing: "You can drop the parentheses if you use braces. But you can't drop both". Though you're right, this is why it'll never happen.

      Basically, C had a choice of eliding the parentheses around the condition or the braces around a single-statement block, and they chose the braces. With a half-century of hindsight, that was probably the wrong choice.

      1 reply →

  • > One of the few times I get to remember that English is only my second language.

    Most native speakers aren't aware of the terms. They'll call anything by any name.

    There is a significant constituency for "curly brackets {}" and "square brackets []".

    Anyway, there are mistakes you could make that would give you away as a nonnative speaker, but that wasn't one of them.

    • > There is a significant constituency for "curly brackets {}" and "square brackets []".

      Yes, but there is still basically no constituency for “parentheses” (“{}”) or “parentheses” (“[]”), except in some narrow specific contexts; in programming, one example would be discussion of certain Lisp dialects where either all or certain uses of “()” in classic Lisp can (or, in the “certain” case, sometimes must) use the others, in which context “parentheses” are sometimes used generically for all three.

      So, while there is a variety of ways paired delimiters are described by native speakers, the particular use here was still outside of the normal range of that variation.

  • The GP is only correct in America, and only in formal usage.

    In everyday usage in the UK, I’d wager that most refer to () as brackets, [] as square brackets and {} as curly brackets.

    • This is not relevant to the actual context of the remark that was written. The mistake being corrected is the misreading of the word "parentheses", believing it to refer to `{` and `}`. Even in the UK, that conclusion is wrong. So the GP you refer to as "only correct in America" is simply "correct", period (full stop).