Search code examples
phpcommentsstandards

Technical name for long descriptive code block before classes, functions, etc


I know that in PHP (like many other languages) people add descriptive comment blocks with stars before each line before classes, functions and files. Do they have any official name?

/**
* 
* Do these types of bullet-ed block comments have any official name?
* 
*/

Solution

  • This comes from Java's context, called JavaDoc, where you give a paragraph of details, including but not limited to, parameters, return values, etc.

    In case of Java...

    A documentation comment is framed by slash-star-star and star-slash (i.e. /** ... */). The documentation is in the HTML format.

    The HTML format is then rendered by the Eclipse or Netbeans, or other similar IDEs as a tip for the particular function.

    The JavaDoc is just the name, but it can be used for any languages.

    An example of JavaDoc being using for hinting in Eclipse (code assist) is:

    In NetBeans, when the documentation is not found in PHP:

    In NetBeans, using PHPDocs:


    (source: netbeans.org)

    And it displays in NetBeans this way: