David Deutsch wrote:
Good question! (Also: shame on me for not finding those guidelines ealier O_o .../awkward/)
I think the basic recommendation that PSR-1 makes on this are pretty sound: Make a choice and stick with it. As a personal preference, I use StudlyCaps for classes (this is a 'must' in PSR-1), camelCase for methods and under_scores for variables. I find that that helps separate the three concepts, even though it might seem like "hey, why do you use three ways of doing something". Because it's three separate concepts!
We made our choice and we're going to stick with it. Thus use underlines and no caps. And we're not doing PSR-1 here.
From what I've seen in the plugins so far, it seems like RCM pretty consistently uses lowercase_underscored for all three.
Sidenote: My IDE actually gives me a lot of funny warnings about the class names in RCM - something along the lines of "there is probably a conceptual error here, somewhere" I always imagine it standing before me with eyes twitching "dude, this aint right!" ;-)
I'm wondering what your IDE means by "conceptual errors".
Sidenote 2: The Guidelines references PEAR standards. I used to really dislike those, particularly for the ~80 character line limit, which seemed silly ("Oooh, your b/w terminal can only do 80 characters per line!?"). Fast forward a couple of years and I absolutely love an 80 char line limit. It's like an addiction to shortness.* There are a couple of outdated things in there and I might forever think that 4 spaces is silly, but yeah, not as bad today ;-)
Agreed. After this cleanup we should definitely rewrite the guidelines.
*Sidenote 3: This also helped me come around on Namespaces, really. "use... as" REALLY helps keep lines short when using classes and particularly when calling static methods.
We're not there yet.
~Thomas