Skip to content

Conventions

Conventions are a set of rules that are used to define the structure of code. These rules are used to make the code more readable and easier to understand. Conventions are used in all programming languages. On this page we will discuss the conventions that are used in web development in IoT.

Front-end

In the front-end part of your website you are using different languages. You are using HTML, CSS and Javascript. Each of these languages has its own conventions.

  • https://google.github.io/styleguide/htmlcssguide.html

Make sure you are separating your HTML, CSS and Javascript. You can for example create a folder called css and put all your CSS files in there. You can also create a folder called js and put all your Javascript files in there.

Back-end

In the back-end part of your website you are using PHP. PHP has its own conventions.

  • https://www.php-fig.org/psr/psr-12/

Make sure that you are not using HTML in your PHP files. You should separate your HTML and PHP. If you need PHP-data, you can make use of AJAX/Fetch/... and get the data from your API.