I found the terms bracket and brace used interchangeably. Is there a difference, and what is it?
-
3Related: http://english.stackexchange.com/questions/302/what-is-the-most-professional-name-for-squiggly-bracket – RegDwigнt Sep 23 '10 at 14:44
-
4I don't suppose you're talking about things you find at the hardware store? – wuputah Sep 23 '10 at 17:29
3 Answers
"Brackets" is used interchangeably for various symbols:
- angle brackets for <>
- round brackets for ()
- curly brackets for {}
- square brackets for []
- and more, some of which are only used in certain regions or cultures
The more specific "braces" and "parentheses" are almost never used for other than {} and (), respectively. Mathematics has several more (subtle) variations in addition and is formalized more than other fields.
I prefer "braces" for {}, "parens" (informally or in the context of programming) or "parentheses" for (), and plain "brackets" for [], though "square brackets" is sometimes required to be explicit about the latter. This gives you a one-word name for any of those common symbols. (And don't get me started on the problems of angle brackets for grouping... :P)
To provide a non-text counterpoint, "bracketing" in photography is taking multiple exposures around a given value (which value—white balance, ISO, aperture, etc.—depends on what you're targeting). This shows the use of "bracket" to mean "surrounding," which lines up nicely with the text symbols above.
-
6I believe there is a UK/US difference here -> see the question that RegDwight links to in his comment on the question. – Benjol Oct 14 '10 at 04:52
-
1Grave digging here, but correct there is a US vs other-english difference. Braces have been referred to parentheses quite commonly in coding. See: https://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/
If I had the rep I'd downvote as really this is only half an answer and misleading to others.
– Brian Ellis Nov 21 '15 at 15:14
I am not sure about other contexts, but in texts about programming you will often find these terms used as follows:
braces: {} parentheses: () brackets: [] angle brackets: <>
- 377
-
4Only in US can this be relied upon. Also, the language matters to a degree. I've found JAVA and C guys to be more semantically correct compared to web developmers. Obviously strict type language also involving compiling is more detailed oriented so I imagine everyone strives to use common terminology more. – Brian Ellis Nov 21 '15 at 15:18
-
2@BrianEllis: The ASCII standard gives names to its characters, so for any programming done in an environment using an ASCII character set, these are the correct terms. If you're using EBCDIC, feel free to ignore the ASCII names. – Ben Voigt Jan 08 '17 at 18:34
-
1Please consider the "American" part of "American Standard Code for Information Interchange." Sure, that's the name of the characters according to ASCII, and sure, pretty much every computer uses ASCII. However, different English regions call those characters different things. – Timothy Zorn Feb 11 '18 at 17:03
-
Also of note in programming, "angle brackets" are also commonly referred to as left and right carets. Since these characters can represent either a form of bracket, less than/greater than operator, or object hierarchy delimiter, this term is generally preferred when you have no context for how it is being used. Caret is common of both American and European developers – Nosajimiki Aug 07 '18 at 16:49
-
@BenVoigt Regarding EBCDIC, in recent times (at least) IBM calls these characters in EBCDIC exactly the same names as what they are called in ASCII. – Simon Kissane Mar 19 '21 at 08:35
Square brackets [] are often simply called brackets, while curly brackets {} are often called braces (in the US, at least). Someone using the term braces for square brackets is making a mistake, because most people will assume that person means curly brackets. So, these terms are not interchangeable, although braces are a type of bracket.
- 50,402
-
7In UK English, the word brackets on its own, without modifiers, would usually be understood to refer to round brackets. – TRiG Oct 15 '10 at 14:24