| Both sides previous revision Previous revision Next revision | Previous revision |
| public:computer:coding_rules [2021/12/07 13:56] – alex | public:computer:coding_rules [2021/12/07 14:54] (current) – [Coding Conventions] alex |
|---|
| ===== Coding Conventions ===== | ===== Coding Conventions ===== |
| |
| ^ Coding Conventions ^^^ | ^ Coding Conventions ^^^^ |
| ^ name ^ description ^ examples ^ | ^ name ^ description ^ Usually used ^ examples ^ |
| | kebab-case \\ lisp-case \\ spinal-case | only small cases, spread with hypens | kebab-case, lisp-case, spinal-case | | | flatcase | | package at Java, etc. | | |
| | camelCase | | camelCase | | | kebab-case \\ lisp-case \\ spinal-case \\ caterpillar-case \\ dash-case \\ hyphen-case \\ css-case | only small cases, spread with hypens | css, | kebab-case, lisp-case, spinal-case | |
| | PascalCase | | PascalCase | | | camelCase | | variables at Java, C#, etc. | let myVariable: string | |
| | snake_case | | snake_case | | | PascalCase \\ CapitalCamelCase | | Class | class MyClass | |
| | UPPER_CASE_SNAKE_CASE | | UPPER_CASE_SNAKE_CASE | | | snake_case \\ c_case | | variables at Python, PHP, c, etc. | snake_case | |
| | | UPPER_CASE_SNAKE_CASE (UPPER_CASE) \\ MACRO_CASE | | | UPPER_CASE_SNAKE_CASE | |
| | | COBOL-CASE \\ TRAIN-CASE | | | COBOL-CASE, HTTP-Header-Case | |
| | | undercore notation | prefixed by "_" followed by camelCase | | _idUser | |
| | | Hungarian Notation | variable names prefixed by metadata data-types which is out-dated | C++, MFC | strUsername | |
| |
| |
| * [[https://chaseadams.io/posts/most-common-programming-case-types/|Most Common Programming Case Types]] | * [[https://chaseadams.io/posts/most-common-programming-case-types/|Most Common Programming Case Types]] |
| | * [[https://stackoverflow.com/questions/17326185/what-are-the-different-kinds-of-cases|What are the different kinds of cases? @stackoverflow]] |