Coding Standards - pmvdbijl7/cinemeet GitHub Wiki

To ensure that the programming style, procedures and methods of the programming language are the same throughout, I have set up a number of coding standards. These are, as it were, collections of rules and guidelines to keep the code clear and consistent. Adhering to these coding standards will increase the quality of your code and make it easier to maintain. Besides that, it can save you a lot of time and it is easier if you work with a team on your code in the future.

HTML

When creating/maintaining an HTML file, you should adhere to the following coding standards:

  • Provide semantically correct html, unless you want to use <div>'s for positioning.
  • Make sure to use hyphens (-) when defining classes. For example: class="form-group".
  • Always keep all code in English (including comments).
  • Make sure all elements are well indented everywhere. (This can of course easily be done with a formatter.)

CSS

When creating/maintaining a CSS file, you should adhere to the following coding standards:

  • Be consistent with the color codes. For example, do not mix the Hex format, RGB format and HSL format.
  • Make sure that the CSS code is in sequence of the HTML structure of a page. So start with the header, then the main and then the footer etc..
  • Use variables as much as possible so that if you want to adjust a base color you only have to do it once.

JavaScript

When creating/maintaining a JavScript file, you should adhere to the following coding standards:

  • Make sure that all naming conventions are always written in camelCase.
  • Always use the arrow function (() => {}) instead of a normal function (function() {}) when it does not need function name.
  • Use constants (const) and let's everywhere instead of variables (var's)

Folder-/Filenames

  • Folders should always be spelled with "snake_case".
  • Files should always be spelled with "camelCase".
⚠️ **GitHub.com Fallback** ⚠️