Thursday, 29 August 2013

Comments in Programming


What is Comments and how it is use?

Comments is the Essential element of all programming language.And It is use mostly all top most languages like

  • C
  • C++
  • C#
  • JAVA
  • Python
  • PHP
  • Perl


Comments are use to describe the logic ,methodology and for remembering  the code working.
Every Programmer must use these comments.Actually this is use in each and every programming language.
Let consider ,if you write some programming code and after 1 month you see those code then its very hard to understand the logic behind the code.

There are different type of comments

Single line Comment  //
Multi Line Comment  /*   */

Complier leave the comment and  understand that this is a human code not for me



Example


int number;   //This is declaration


Now compiler only work on "int number;" and leave the remaining part of this line



Similarly case with multi line comments


int number =4;

number++;
/*Initialization the integer number
and increment the number value 
by 1 value;
*/



No comments:

Post a Comment