|
|
|
|
|
by ludwigvan
4886 days ago
|
|
> Random piece of feedback: it's weird to use data-model_id (instead of data-model-id) I have thought about this one too in my own applications, and I seem to switch back and forth. The good thing about using underscore is that the variable name can match on both sides of the expression: var model_id = $foo.data('model_id');
vs var model_id = $foo.data('model-id');
Mixing camelCase with dash seems a bit weird for me, because now there is a delimiter delimited, and case delimited convention: `data-modelId`.I am trying to use camelCase for new code in other parts of the code though, as it seems to be the general convention in JS. [0] [0] http://ozmm.org/posts/javascript_style.html |
|
http://cl.ly/image/2c113k1h1L41