Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

Help Me/Question What Is The Need Of Comments In Php?

Discussion in 'PHP Programming' started by Doominic anderson, Feb 17, 2016.

  1. Doominic anderson

    Yellow Belt

    Joined:
    Jan 30, 2016
    Messages:
    399
    Ratings:
    +21 / -0
    We all know that PHP allows us to create dynamic web pages by embedding PHP scripts in an HTML. Page using the "<?php ?> tags".
    There are many concepts of PHP which are used to make the web page user friendly like Variables,Strings,Comments,Arrays,Operators e.t.c.
    What is the use of Comments in PHP, why it is he need of Comments in PHP?
     
  2. Manish Mishra

    Yellow Belt

    Joined:
    Dec 22, 2015
    Messages:
    1,025
    Ratings:
    +159 / -0
    It makes you doing very friendly coding for your own convenience. If you write comments along with the codes you are making it simpler for the other people to understand how the things have been done.

    Also, it may help a lot for the beginner programmer to understand some coding part with the help of comments. It gives a good structure and making you well understanding with the coding. For few parts that you may like to change you can add such comments for later changes.
     
  3. RADHESHYAM GUPTA

    Yellow Belt

    Joined:
    Feb 13, 2016
    Messages:
    362
    Ratings:
    +20 / -0
    There are so many comments are available in PHP such as:-
    /*......... .......... ..............*/ (Multi line comment).
    //............. .............. (single line comment)
    Comments is the very useful to understand the code of PHP for PHP programmer.
    Suppose you are a PHP programmer and you work on a php project but you can not understand their code it is only the reason that is Comments. So comments is very important in all programming.
     
  4. steve taylor

    Yellow Belt

    Joined:
    Feb 12, 2016
    Messages:
    769
    Ratings:
    +25 / -0
    Comment and description of code makes whole program to readable. Any programmer can easily read and understand the program. In the modern programming languages existing code are used again and again so here readability is required to perform some small changes according to need in the existing program code.
     
  5. krishatg

    Yellow Belt

    Joined:
    Jan 16, 2016
    Messages:
    240
    Ratings:
    +14 / -0
    A comment is a part of code that is not executable . Its purpose is to be read by someone who is editing the code.
    1. To make code easily understandable to others: The comments make the other programmers easily understand what you were doing . This makes easier for them to work on it, and to edit it.
    2. For self understanding: we have always experienced coming back to edit our own work a year or two later and have to review whole code to figure out what we did. Comments can remind us of what we were thinking, to avoid having to understand our own workings.
     
    #5 krishatg, Mar 7, 2016 at 5:55 AM
    Last edited: Mar 7, 2016

Share This Page