(For PHP projects, at least -- note that PHP is open-source and has an important community ; so, many things are quite driven by what's done in the community)
First of all, when using a Framework on a project (ie, always), we try to stick to its policy, if clearly defined (it's the case for Zend Framework, at least) : it ensures anyone who will come to work on this project can :
- find a definition of the standard
- re-use it on any other projects that use the same framework
- even when going to another company, or working for another client
- or when coming from another company ;-)
Considering we are only using between 3 and 5 frameworks for PHP projects in the company I work for, and that many rules defined in their standards are the same, it's not a real problem.
Same applies if coding inside/arround some kind of CMS, for instance, of course.
When not using a specific framework, we try to stick to a common set of rules widely accepted amongst the PHP community : same way, it ensure those rules are well-known (even by new-comers to our company), easy to find, and that many people did try them and enhanced them.
About comments, there is one tool that is well-used in PHP : phpDocumentor (about the same thing as javadoc) ; it defines a standard -- this one is the de-facto standard, as there is no other tool that is used that much.
About specific comment-tags :
- we always use @param / @return : they are integrated in the IDE, to provide type-hinting, so are useful
- else, we don't use much : a couple of lines to say what the method does if it's not obvious ; a couple of lines if a difficult algorithm is used.
Camel-case or other : we stick to what is common amongst both the PHP community and frameworks :
this_is_a_function
And
ThisIsAClassName
And
thisIsAMethodName
In HTML : as much as possible, we don't use HTML comments, because they are sent to the browser :
- means bigger pages (ok, not that much)
- means giving away informations the user doesn't need
If possible, we use comments from the templating-engine.
In CSS : we comment when needed ; more important thing is to use several small CSS files, quite specific (even if using a merge-tool during the build process)
But, maybe more important than all this : we try to use "clean" code, with small methods that only do a small "unit" thing, with self-describing names and all
It doesn't do magic, but it helps understanding the code... And, also, testing it, re-using it, ...
Also, as Nate said : these are mostly guidelines -- except if specifically required by a client... In which case you have to put some automatic tool (In your build process, for instance) to verify they are followed by the letter.