5 ms·
Hey eranation, for multiple words we can use CamelCase and avoid underscore. And when we use multiple words, both 'imageModel' and 'ImageModel' are good practic
by azamuddin 14y ago
Hey eranation, for multiple words we can use CamelCase and avoid underscore. And when we use multiple words, both 'imageModel' and 'ImageModel' are good practice, see here http://ricostacruz.com/backbone-patterns/#naming_convention http://ricostacruz.com/backbone-patterns/#naming_convention
and about adding multiple things to collection the reason for using 'add' instead of 'reset' is, 'add' will maintain the existing data, while reset will clear the existing data then replace it.
I like the code schools's part 1 and 2 which was written by Jeremy Ashkenas, it is simple but practical, I agree.
- eranation 14y agoI have to disagree, the pattern for classes is clearly starting with an uppercase letter, and for instances with a lower case letter. In the example we have a model class, not a model instance. > Classes often start in uppercase letters, while instances start with lowercase letters.