Search code examples
terminologycurly-braces

Is there a proper term for "curly braces" among programmers - { }


{ }

I'm wondering if there is a more professional term other than "Curly Brace" that is used by programmers.

A google search said they are also referred to as "brackets", but in my experience when people say brackets they mean the square "[ ]".


Solution

  • Use whatever floats your boat, in most contexts; on account of regional flavours. If you feel extra formal, you might be using "curly bracket" instead.

    Wikipedia shows many variations on names for the { } symbols. https://en.wikipedia.org/wiki/Bracket#Names_for_various_bracket_symbols

    You could also imply them, sometimes, by talking about blocks, loops, switch block, if block, and other similar structures if the programming language in question features them. Programmers will just visualize the brackets as being present, as necessary:

    The else-block is never executed because X.

    Another way: imply the type by its relative position/usage. If the context is right, it'll be a curly bracket.

    You're missing a closing bracket for the while-loop, that's why the compiler failed.