Lecture # 3 Comments:-
Commenting in PHP
A Comment is a Programmer's Readable Explanation or Annotation in the Source Code of a Program. They are added with the purpose of making the Source Code Easier for Humans to understand, and are generally ignored by Compilers and Interpreters.Uses
Planning and Reviewing
Code Description
Algorithmic Description
Resource inclusion
Metadata
Debugging
Automatic Documentation Generation
Syntax Extension
Stress Relief
# This is a comment, and
# This is the second line of the comment
// This is a comment too. Each style comments only print
"An example with single line comments";
?>
Multi-lines Comments
They are generally used to provide pseudo code algorithms and more detailed explanations when necessary. The multi line style of commenting is the same as in C. Here are the example of multi lines comments.
/* This is a Comment with multi line
Author : Mohammad Usman
Purpose: Multiline Comments Demo
Subject: PHP */
print "An example with multi line comments";
?>
Comments
Post a Comment