-
Notifications
You must be signed in to change notification settings - Fork 0
Conventions
Wiki pages should be named:
File-Name.md
.
If a page refers a specific topic of the project's timeline then it's name should be prefixed by the corresponding timeline entry number:
1.File-Name.md
-
Discussion of the topic on StackOverflow here.
-
Keywords all in uppercase.
- Correct:
SELECT
,DROP
; - Incorrect:
select
,Drop
;
- Correct:
-
Table and variable names in PascalCase, a camelCase variant, where each each word starts with an uppercase Letter:
- Correct:
UserId
,UserRoutes
. - Incorrect:
userId
,user-routes
,Userid
,user_id
.
- Correct:
-
Each query should end with a semi-colon.
-
The primary key should refer the table it belongs to:
- Correct:
SELECT UserId FROM user;
- Incorrect:
SELECT id FROM user;
-
Foreign keys and fields should be named consistently across all tables. For instance if a field is called
zip
there should not be one calledzipCode
in another table. -
Column and Table names should be singular,
User
instead ofÙsers
. -
Prefixing and Suffixing should be avoided.
Variable naming follows camelCase
naming rules:
- First letter is lower case.
- Each word after the first should begin with an uppercase letter e.g:
someVariable
.
Classes follow PascalCase
naming rules:
- First letter is upper case.
- Each word after the first should begin with an uppercase letter e.g:
SomeClass
.
Function naming follows camelCase
naming rules:
- First letter is lower case.
- Each word after the first should begin with an uppercase letter e.g:
someVariable
.
Package naming follows camelCase
naming rules:
- First letter is lower case.
- Each word after the first should begin with an uppercase letter e.g:
somePariable
.
Each function should explicitly declare its return type:
fun someFunction () = someService.do() //incorrect
fun someFunction () : someReturnType = someService.do() //correct