Search
Friday, March 02, 2001 ..:: Home ::.. Register  Login
   Calendar  
     
  
   Search  
     
  
   Disclosure  
     
  
   TechTidBits (Blog)  

Brackets, braces, parenthesis, oh my!

Feb 19

Written by:
Thursday, February 19, 2009 10:12 PM  RssIcon

When someone tells you to put in a brace in your code, do you know if they're talking about ( or { or [ or even <?  Read on for some concrete definitions.

With C# growing up from it's C/C++ roots, it seems natural for it to have semicolons.  And there's also all the brackets, parenthesis, and braces!  But do you know the technical differences between them?  I'm always forgetting, so here's my permenant reminder for myself (as long as my server stays turned on that is :>).

?

Term

AKA

Uses

( xyz )

Parenthesis

 

  • method calls (outgoing or incoming) to pass parameters
  • order of precedence

[ xyz ]

Brackets

Box Brackets or Square Brackets

  • arrays
  • attributes (.NET languages)

{ xyz }

Braces

Curley Brackets

  • code blocks
  • scope delimiters
  • composite structures

< xyz >

 Chevrons

Angle Brackets, Diamond Brackets 

  • html tag delimiters
  • generic class argument delimiters

 

 

References

Wikipedia: Bracket

Tags:
Categories:
Location: Blogs Parent Separator TechTidBits

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
     
  
Copyright 1999-2012 by PCHenry.com   Terms Of Use  Privacy Statement