• Articles
  • How to save your time writing a C++ code
Published by
Jan 8, 2012 (last update: Jan 8, 2012)

How to save your time writing a C++ code in Microsoft Visual Studio 11?

Score: 3.0/5 (40 votes)
Microsoft Visual Studio 11 is the latest version of the Microsoft Visual Studio. This new compiler is so good to experience that I would suggest the readers to at least try once programming in MS VS 11.
There are many features which distinguish Visual Studio from other compilers such as gcc, Borland, Dev C++ etc. The two that really impress is the Auto completion which includes:

1. Intellisense
2. Code snippets

Intellisense is a feature which serves as documentation and disambiguation for variable names, functions and methods. In simple terms, it warns the programmer about his syntax errors and other common errors (other than semantic ones) at the time of coding. This may sound puny, but if someone is a developer at a certain software company and he/she writes thousands of lines of code daily, this feature is a real blessing for that person. Here take a look. MS VS will underline any line with red which will contain any syntax error.

The earlier versions of MS VS did not have Code snippets generation in them. This latest iteration has got this feature which is very time saving. A normal programmer implements loops, I guess, approximately 10 times in an average C++ program. So, this feature helps one to save his time writing loops again and again and so buys him time to concentrate more on the logic of the program rather than coding. Here is a snapshot from my Visual Studio 11 Developer Preview showing how MS VS generates a whole code snippet for a class by simply writing "cl" in the script window.

This is what happens after I hit enter on "Code snippet for class"