P3X GitList Demo
GitHub
Repo
Changelog
To do
Releases
Themes
Language
Afrikaans
العربية
বাংলা
Català
Čeština
Dansk
Deutsch
Ελληνικά
English
Español
Suomi
Français
עברית
Magyar
Italiano
日本語
한국어
Nederlands
Norsk
Polski
Português
Română
Русский
Српски
Svenska
Türkçe
Українська
Tiếng Việt
中文
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
a35b8d113cdb83076ea0db9dbee5240b4d96cb5c
Branches
dependabot/npm_and_yarn/picomatch-2.3.2
master
Files
Commits
Log
Graph
Stats
corifeus.git
artifacts
readme
code-style.md
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Delete
Are you sure to delete this file?
Editor
Raw
Blame
History
Markdown code
Clone
SSH
HTTPS
This file ( 4kB ) exceeds the allowed full mode (48 kb) size. The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height mode, although some users like it.
artifacts/readme/code-style.md
[//]: #@corifeus-header # 🎮 Corifeus Matrix [//]: #@corifeus-header:end # Code style ## Case we use ```camelCase = theFirstIsSmallTheRestIsCapital``` ```kabeb-case = meaning-only-lower-case-and-a-z-and-dash-and-numbers``` ## Case we do not use ```PascalCase = JustAlphaAndAlwaysCapitalWords``` ## CSS Prefix ``` kabeb-case ``` **Prefix so that get away form namespace clashes.** ```.cory = corifeus``` ```css .cory-something { font-family: "Corifeus"; } ``` ## HTML Prefix ``` kabeb-case ``` **Prefix so that get away form namespace clashes.** It is both for tags and attributes. ``cory = corifeus`` ```html <cory-element cory-attribute="kabeb-case" class="cory-something"/> ``` ## Url ``` kabeb-case ``` ```bash https://localhost/very-long-sentance/is/just/kebab-case.html ``` ## Path ``` kabeb-case ``` ```bash /module-one/love/live/path.js /try/code-style/by/class.js ``` ## Filename ``` kabeb-case ``` ```bash // function camel-case.js // class camel-case-is-kebab-as-well.js // html file kabeb-case.html // regular file kebab-case.any kabeb-case.js kabeb-case.pdf kabeb-case.html kabeb-case.css ``` ## Namespace ``` camelCase ``` The namespace = ```corifeus``` ```js // JavaScript global.corifeus.camelCase = () => console.log('camelCase'); global.corifeus.camelCase = class camelCaseClass {}; ``` ## Variables ``` camelCase ``` ```js // JavaScript const variableIsCool = 'camelCase'; let anotherVariable = false; var oldTypeVariable = 'cool'; ``` ## Functions ``` camelCase ``` ```js // JavaScript function justSimpleFunction() { console.log('alsoCamelCase') } ``` ## Prototype based class ``` camelCase ``` ```js // JavaScript function prototypeBasedClass() { console.log('likeAClassIsCamelCase'); } prototypeBasedClass.staticFunction = function() {} prototypeBasedClass.staticVariable = true; prototypeBasedClass.prototype.instanceFunction = function() {} prototypeBasedClass.prototype.instanceVariable = true; ``` ## Classes Usually, we do not use OOP in JavaScript, for us, it is too functional to use OOP instead. Only TypeScript uses a lot of OOP. JavaScript is much functional. We like simple solutions, instead of being too strict programming, of course JavaScript allows some strict functions... 🙈 ``` camelCase ``` ```js // JavaScript class simpleClass { constructor() {} instanceFunctionCamelCase() {} get instanceProperty() { return true; } set instanceProperty(value) { this._instanceProperty = value; } static classMethod() { console.log('camelCase'); } static get classProperty() { return 'camelCase'; } } ``` ## Objects ``` camelCase ``` ```js // JavaScript const objects = { variableNow: camelCase, methodName: camelCase, nameOfTheClass: camelCase, staticFuncitonName: camelCase.static, instance: camelCase.variable } ``` [//]: #@corifeus-footer --- [**CORIFEUS**](https://pages.corifeus.com/corifeus) Build v2019.1.8-5 [](https://www.facebook.com/corifeus.software) [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [](https://www.patrikx3.com/en/front/contact) ## P3X Sponsors [IntelliJ - The most intelligent Java IDE](https://www.jetbrains.com) [](https://www.jetbrains.com/) [](https://www.nosqlbooster.com/) [The Smartest IDE for MongoDB](https://www.nosqlbooster.com) [//]: #@corifeus-footer:end