My professor today told me that I should comment my code (PHP & Javascript) in all caps…is there a substantive reason for this or is this an issue of best practice?
If so, why is it better to comment in caps over sentence case?
My professor today told me that I should comment my code (PHP & Javascript) in all caps…is there a substantive reason for this or is this an issue of best practice?
If so, why is it better to comment in caps over sentence case?
First, stylistic questions like this can be a little subjective, so there's not necessarily a clearly "right" or "wrong" answer. With that said, I've never seen that done in any professionally-written code, nor have I seen that practice recommended in any coding standard.
Consider the following paragraph (taken from here):
GIVEN THAT O'BRIEN SHOWS A HIGH LEVEL OF AWARENESS OF THE PARTY'S DECEPTIVENESS AND MALICE (E.G. THE FACT THAT HE ADMITTED TO BEING INVOLVED IN CREATING AND PROMOTING THE GOLDSTEIN MYTH), TO WHAT EXTENT DOES HE ACTUALLY BELIEVE IN THE SYSTEM HIMSELF? WHY WASN'T HE CONSIDERED A THOUGHT CRIMINAL? OR WERE INNER PARTY MEMBERS NOT ACTUALLY EXPECTED TO CONFORM TO THE PARTY'S BELIEFS TO THE SAME EXTENT THAT OUTER PARTY MEMBERS WERE AS LONG AS EVERYONE ELSE WAS CONVINCED THAT THEY DID? OR IS HE PRACTICING SOME FORM OF DOUBLETHINK?
Obnoxious to read, isn't it?
Here's the paragraph in "normal" text:
Given that O'Brien shows a high level of awareness of the Party's deceptiveness and malice (e.g. the fact that he admitted to being involved in creating and promoting the Goldstein myth), to what extent does he actually believe in the system himself? Why wasn't he considered a thought criminal? Or were Inner Party members not actually expected to conform to the party's beliefs to the same extent that Outer Party members were as long as everyone else was convinced that they did? Or is he practicing some form of doublethink?
The second is obviously way easier to read. That being the case, capitalizing the comments only makes them more difficult to read.
The only reason I can think of that someone might recommend that is to make it easy to distinguish from the code, but that hasn't been a valid reason for a long time (unless you're trying to write your code in Notepad or some other really awful tool) because modern IDEs fix that problem with syntax highlighting.