The Brackets War!

Do you know there are two ways of writing a block of code in a program? No? Let me show you πŸ™‚

Non-Cuddled Braces

A sample code with non-cuddled braces

Cuddled Braces

A sample code with Cuddled Braces

This is war is one of the “Holy Wars” which consist of “Linux vs Mac vs Windows” , “Vim vs Emacs” , “GNOME vs KDE” blah blah πŸ˜› . Oh I forgot to mention, I wrote that code in Vim (my personal favorite editor, did I just start a holy war? Maybe IΒ  started that right from the beginning of the post πŸ˜‰ . I think I should write a blog on the power of Vim as well )

Both method of writing the code is correct and compiler no way gives error on any one. Its just the way of writing the code and bothΒ  have their own advantages.

Cuddled Braces tell the reader of the code that “Hey! The code block has started” and also helps in finding the statement for which the code block is all about.

Non-Cuddled Braces help the reader easily figure out the block of code and the code blocks which are nested within that block. They also help the reader to know the length of the code block as the braces are aligned.

My Opinion?

Well personally I prefer Non-Cuddled Braces over the Cuddled ones as they suit perfect for my eyes. What’s your take?

Hello World!

Hey fellas, this is my first blog so spare me πŸ˜› . So I will introduce to you a bit of myself. My name is Manish Kumar Mishra aka MKM and I am a Computer Engineering student at Netaji Subhas Institute of Technology at Delhi,India. I love Programming and the language I prefer is C++ because I learned that in my high school πŸ™‚ . Since this is my first bog, I have no idea what to write πŸ˜› . Stay tuned for more blogs to come!