Think About the following code $a=”I Am John Doe”;
echo “Total Number of words in $a is “.count($b);
Now how about this, $name=”I Am John Doe”;
echo “Total Number of words in $name is “.count($num_of_words); Well, the example was too simple. But things can go terribly wrong when not using meaningful variable names in PHP or any other language’s codes. Even you’ll forget at some point of time what was the variable $a for and $b. And it really pisses other developers when using some one’s code which didn’t follow good naming convention. And when i see codes in those messy fashion it makes me angry like the Goku below.
And the end result is inefficiency and waste of valuable time. There are various naming conventions practiced for coding. PHP has it’s own style where underscore is massively used. And it’s quite comfortable to use. $last_name is more readable than $lastname. So variables/functions can be made quite meaningful when they are written. To cut the story short, here’s some suggestions from me: