When I first started working on Vanilla (version 1), I knew that my naming conventions for it were not the same as most PHP applications.
Due primarily to my Windows programming background, I was in the habit of WritingThingsLikeThis instead_of_like_this.
When I released Vanilla, I braced myself for the backlash against my naming conventions; strangely, I don’t remember anyone ever saying “Boo” about them.
In my current Lussumo-related work, I recently came across a problem whereby I needed some of my class methods to contain lower case letters only. I found myself doing $Object->method_name(); and I’ve since been turned upside down. All of my practices are breaking because of this one requirement, and now I’m stepping back to see what the community at large has to say about this. I’ve done some research through various other php-based open-source projects and found that most of them have similar (but not exactly the same) methods for naming conventions.
ZEND, being the masters of PHP follow something along these lines:
$variableName = '';
function functionName($variableName) {}
class ClassName {
methodName($variableName) {}
}
Other open-source projects follow practices like this:
$variable_name = '';
function functionName($variable_name) {}
class className {
method_name($variable_name) {}
}
And my traditional Lussumo style has been:
$VariableName = '';
function FunctionName($VariableName) {}
class ClassName {
MethodName($VariableName) {}
}
Now, camelCasedNamingConventions give me the shivers. I don’t know why, but they make me wince. So, if I were going to change, I’d be more inclined to do something along these lines:
$variable_name = '';
function function_name($variable_name) {}
class ClassName {
method_name($variable_name) {}
}
Anyone have any input? thoughts? care in the least?