Category Archives: PHP

Code Writing Guideliness

Writing a program is not easy but while a program is written every programmer need to write comments for every program. It is very important to write comments because when the programmer has to make changes after certain time. Then these comments help him to know what he has done last time. Some times the other programmer also views the code and with the help of these comments it makes easy to the programmers to understand the source code. While compiling or interpreting the source code the comments made are not compiled or interpreted. In language there are two ways for writing comments are:

a) Single Line comment. – The single line comments are generally written to describe the purpose of the line code written. The single line comments are always written with //. They are not closed by any sign and it the end of the line the code is ignored.

b) Multi line comments. – The multi line code is written to describe the purpose of the code or to explain the purpose of the function and in open source the opening code starts with the license comments. These are started with /* and this will have to be closed with */. Please not that it is very important to close the comments.

Another obvious feature is that most lines of statements in the program end with a “;” and that some do not. Either forgetting a “;” or adding one where it isn’t needed is a common C program bug. Lines of code are grouped by using curly brackets (“{ }”).

%d bloggers like this: