backbone-express-spa
backbone-express-spa copied to clipboard
File naming conventions
Files should be named consistent (e.g. /public/js/apps/home/app.js and /public/js/apps/home ... MainView.js). Further I would suggest using dashes ("main-view.js") instead of using camelcase notation for file names.
My rule of thumb is - the name of file, corresponds to the name of exported entity
.
- If file defines a module (js object), like
viewManager
, filename -viewManager.js
. - If file defines a constructor-function, like
MainView
, filenameMainView.js
.
I could agree, it's not that consistent as it should be (router.js
as example).
Thinking about idea with dashes. I never used that conventions in my projects.. and in terms of consitency with source code, it looks a bit contradictory. But camelCase, does not work better either.
Here I can see 'flat' convetion style. So, files are simply views/mainview.js
, models/task.js
, collections\contacts.js
etc. It makes sense to me, actually.
What do you think?