Take the tour ×  I know your naming conventions are supposed to
follow how it's written in the language's documentation. Which
is this:  CSS: my-variable  JS: myVariable  PHP: my_variable
But this is a huge mess, especially when sharing information
between JS and PHP.  Quick Example (this is how I'm currently
naming things):  $my_variable = 5;  <div data-my-variable="<?php
echo $my_variable?>"></div>      var myVariable =
$('div').attr('data-my-variable');     $.get('/get-info',
{my_variable: myVariable}, function(data) {         //should the
get-info.php file be returning         //under_scores or
camelCase back to JS?  Any advice? What do you do? I'm thinking
about just using one convention everywhere.  share|improve this
question "to follow how it's written in the language's
documentation. " Not really. It's more a community thing than a
documentation thing. –  PeeHaa Oct 15 '12 at 17:52 camel case is
always the best. that being said, this is completely subjective
and the question should be closed as such