Does HTML5 change the standard for HTML commenting?

There is no new standard for comments in HTML5. The only valid comment syntax is still <!– –>. From section 8.1.6 of W3C HTML5: Comments must start with the four character sequence U+003C LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS (<!–). The <! syntax originates in SGML DTD markup, which is not part … Read more

How comment a JSP expression?

Pure JSP comments look like this: <%– Comment –%> So if you want to retain the “=“.you could do something like: <%–= map.size() –%> The key thing is that <%= defines the beginning of an expression, in which you can’t leave the body empty, but you could do something like this instead if the pure … Read more

Comment the interface, implementation or both?

As a general rule, I use the same DRY (Don’t Repeat Yourself) principle as with code: on interface, document the interface on implementation, document the implementation specifics Java specific: when documenting the implementation, use {@inheritDoc} tag to “include” javadocs from the interface. For more information: Official javadoc documentation Some unofficial advice.

Convert PHP closing tag into comment

Use a trick: concatenate the string from two pieces. This way, the closing tag is cut in two, and is not a valid closing tag anymore. ‘?>’ –> ‘?’.’>’ In your code: $string = preg_replace(‘#<br\s*/?’.’>(?:\s*<br\s*/?’.’>)+#i’, ‘<br />’, $string); This will make // comments work. For /* */ comments to work, you’d have to split the … Read more

PHP function comments

Functions: /** * Does something interesting * * @param Place $where Where something interesting takes place * @param integer $repeat How many times something interesting should happen * * @throws Some_Exception_Class If something interesting cannot happen * @author Monkey Coder <mcoder@facebook.com> * @return Status */ Classes: /** * Short description for class * * Long … Read more