1 character = 1 byte
1 character = 1 byte
....(o_ Penguins
.---/(o_- techno_racing
+(---//\-' in
.+(_)--(_)' The McMurdo 500
No, there's rarely a reason to do that. If a function contains a lot of complex code that can't be easily understood, there's a handy way to label it: abstract it out into other functions, with descriptive names.
There's one exception, of course, which is when writing embedded documentation for parsing by tools like PHPDoc, JSDoc. JavaDoc, Doxygen, Haddock, &c.
The # comment form in PHP is discouraged by PECL style guides. Refrain from using it.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
How about SQL? No one ever seems to comment their queries...
Single line
MultilineCode:SELECT * FROM some_table--Comment
Code:SELECT * /* Comment goes here*/ FROM some_table
I guess it just doesn't seem feasible to most people... I never thought of using comments in SQL queries because I always looked at them as strings (in PHP), so I didn't think you could use a comment. I didn't realize that SQL had its own commenting system.
- Mike
Me too, and if anything. I'd just comment it out in the php, after the string. It also makes it look untidy, like Twey said in his first post in this topic.
Jeremy | jfein.net
quite informative.![]()
Please don't mind me. I am just posting a lot of nonsense.
SQL comments aren't usually used in tiny strings of code like those you probably use embedded in your PHP. They're used for things like big tables stored in separate files, or large stored procedures.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Code:_This is another type of comment in CSS. _It both saves you one byte over // _AND is not recognized as a comment by IE. _Think about how useful that could be!
....(o_ Penguins
.---/(o_- techno_racing
+(---//\-' in
.+(_)--(_)' The McMurdo 500
Would it be very useful if it isn't recognized as a comment in IE? I really didn't know if you were being sarcastic or not...
-magicyte
It's useful for IE hacks. Conditional comments are vastly preferable, though.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks