This repository has been archived by the owner on Nov 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Naming Rules and Coding Guidelines
Yu-Jen Lin edited this page Apr 20, 2017
·
1 revision
Follow this one: naming convention
camelCase
// bad example
function MyFunction() {...}
// good example
function myFunction() {...}
- Variables with multiple words should always use an underscore between words.
- Confusing variable names should end with the variable type.
- No Abbreviations
// bad example
var deliveryNote = 1;
// good example
var delivery_note = 1;
To use camelCase, when sometimes it is impossible to declare a function directly, the function variable name should match some patterns which shows that it is a function.
// good example
var doSomethingFunction = function () { ... };
// or
var tool = {"doSomething": function () { ... }};
// bad example
var doSomething = function () { ... };
All of the variables store information grabbed from the database (Settings) should end with _data
Example:
-
all_comic_data
: store all of the comic data from the database -
comic_data
: store one comic data from the database
filename should be *-viewmodel.js
and put under ./renderer-process/viewmodels/
filename shouldbe *-viewcontroller.js
and put under ./renderer-process/viewcontrollers