What’s the difference between Brackets, Braces, and Parentheses!

What’s the difference between Brackets, Braces, and Parentheses!

Paired programming is a great opportunity to improve your communication skills and a key part of that is using the proper terms to refer to things; for example brackets, braces, and parentheses.

You may think these names are superfluous or that this article is condescending but I implore you to give it a shot in your next pairing session and see if it reduces the miscommunications that occur when talking through code.

Definitions

  • [Brackets]: Often used in array syntax.

  • {Braces}: Used to begin a method or in JavaScript used to define an object

  • (Parentheses): Used to declare the parameters or arguments that will be used (yes they are different!)

  • Bonus: <Angle Brackets> Often used for type generics but more commonly used independently for inequality comparisons (greater/less than)

I hope this helps some folks improve their understanding of programming syntax and have more productive pairing sessions. This may seem straight forward but its shocking how often I say “parentheses” and get a confused look during pairing sessions but after quickly explaining these three terms it never happens again.