I understand that this is a completely subjective question, but recently I have been creating PHP classes which I would like to distribute to the PHP community, and I was wondering what variable naming convention is most used (other than creating a name which describes the value)?
I don’t know where I picked it up, but I have been using:
As I’m sure you can tell, the first three characters represent the variable type, and then the name starts with a capital letter. Looking through other published code, it seems no one else uses the prefix for type, and only lower case is used. I just want coders to be able to seamlessly incorporate my classes into their projects. I figure I can’t make everyone happy, but most would be nice.
Thanks for your opinions,
Itshim
I don’t know where I picked it up, but I have been using:
Code:
$strName = ‘Name’;
$arrNumbers = array(1, 2, 3, 4);
$intCount = 42;
As I’m sure you can tell, the first three characters represent the variable type, and then the name starts with a capital letter. Looking through other published code, it seems no one else uses the prefix for type, and only lower case is used. I just want coders to be able to seamlessly incorporate my classes into their projects. I figure I can’t make everyone happy, but most would be nice.
Thanks for your opinions,
Itshim