You really need to follow a convention, that's a point you already know. The convention may change according to technology, so if you are programming in PHP it may be one, and in JavaScript it may be another, this is normal because every language has its peculiarities.
Someone may joke that in PHP the convention is not following convention, after all a lot in the library itself and language do not follow. Of course this is bad, just because the language is bad does not mean I should follow this.
There are even programmers who create helper functions with the "right" convention to use instead of the PHP function that does not follow the convention. Few do, mostly because they do not think about it, do not know how to do it or some who think it's not worth the effort to make and maintain the performance that gives a little more work and requires knowledge beyond PHP.
It gets worse among the various frameworks available:
╔═══════════════════════╦═════════════╦════════════╦══════════════╦════════════╦════════════╗
║ PHP Project ║ Classes ║ Methods ║ Properties ║ Functions ║ Variables ║
╠═══════════════════════╬═════════════╬════════════╬══════════════╬════════════╬════════════╣
║ Akelos Framework ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ CakePHP Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ CodeIgniter Framework ║ Proper_Case ║ lower_case ║ lower_case ║ lower_case ║ lower_case ║
║ Concrete5 CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ Doctrine ORM ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ Drupal CMS ║ PascalCase ║ camelCase ║ camelCase ║ lower_case ║ lower_case ║
║ Joomla CMS ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ modx CMS ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ lower_case ║
║ Pear Framework ║ PascalCase ║ camelCase ║ camelCase ║ ║ ║
║ Prado Framework ║ PascalCase ║ camelCase ║ Pascal/camel ║ ║ lower_case ║
║ SimplePie RSS ║ PascalCase ║ lower_case ║ lower_case ║ lower_case ║ lower_case ║
║ Symfony Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
║ WordPress CMS ║ ║ ║ ║ lower_case ║ lower_case ║
║ Zend Framework ║ PascalCase ║ camelCase ║ camelCase ║ camelCase ║ camelCase ║
╚═══════════════════════╩═════════════╩════════════╩══════════════╩════════════╩════════════╝
Font .
Something official .
The important thing is to choose one and follow. No one can say which is best for you.
I like NomePessoa()
. In PHP not so much. What I see most is the use of nome_pessoa()
. But if it is a method, it changes to nomePessoa()
.
In JS it is most common nomePessoa()
.
Convention for JS from perhaps the greatest language guru . And the Mozilla convention . And the Google convention .
Just note that jQuery is not a programming language then it does not have to have a convention for it, but rather for to JS.