I need to name a variable containing ()[]{}, what is the common name for all of them?
Two side questions:
- parentheses is plural, or singular, or both?
- is abbreviating it as
parensunderstandable?
|
I need to name a variable containing Two side questions:
|
|||||
|
|
There isn't really an established generic for them; if I had to say something, I'd probably say enclosing glyphs. Trying to use "bracket" as a generic doesn't really work because "brackets" usually specifically means Seeing that you're naming a variable, I would probably go with Parentheses is a plural; the singular is parenthesis. "Parens" is usual and understandable, yes. |
|||||||||||||||||
|
|
These can be called "brackets." Regarding the side questions, "marks of parenthesis" is the standard term, and parentheses is possible, but a bit breezy. "Parens" is the usual abbreviation. |
|||
|
|
|
In every IDE I've used, the concept of highlighting or validating matching enclosures has been referred to as brace-matching, so I would suggest brace as a candidate to cover all of the glyphs you mention. A brace of things refers to a pair of something (the origin is from hunting), and is synonymous with pair. |
|||||||||||
|
|
I agree with Robusto, The Raven, and ShreevatsaR: You can call all of them braces or call all of them brackets. I have heard I specifically recommend against enclosing glyphs because it is a little too snooty, as if you're some kind of English show-off trying to talk to programmers about programming. I don't mind calling these symbols enclosures, though in programming contexts, this term might be a little too close to closures, which are something else. Don't forget that Finally, so that this answer addresses everything asked, I'll reiterate that |
|||
|
|
Instead of "Enclosing glyphs", which sounds like something a technical standards organization would come up with to classify the symbols for something like Unicode, I'd suggest "grouping symbols." "Grouping symbols" may imply a mathematical usage, but I doubt that the association with math is very strong. |
|||
|
|
|
Wikipedia article on delimiters gives "Bracket delimiters (also block delimiters, region delimiters or balanced delimiters)..." |
|||
|
|
|
PairedPunctuationMarks is the clearest that I can come up with. However, as a programmer I would strongly urge you to name variables based on how they're used instead of what they are. It makes for easier to read code. So, if these symbols are going to be, say, part of the legal ways to delimit a certain kind of token in your code, a name like LegalUserInputDelimitersForFooRegex might be a better variable. |
|||||
|