You are on page 1of 2

Code Style Guidelines

13.07.2016
IoT Moving Assets – PoC Development

Code Style Guidelines
IoT Moving Assets – PoC Development
Frank Kriegl (in agreement with Andreas Wendel, Matthias Aurin)

Contents
1. Who should read this?...................................................................................... 1
2. Why should these guidelines be followed?.......................................................1
3. Code Style........................................................................................................ 1
3.1. Semicolons................................................................................................ 2
3.2. Single Quotes............................................................................................. 2
3.3. Variable Definition..................................................................................... 2
3.4. Using a Linter............................................................................................. 2

1. Who should read this?

These guidelines are addressed to everyone who will take part in development of
AngularJS and/or Node.js projects.
This includes old and new team members, experienced developers and students,

2. Why should these guidelines be followed?

Some steps in the Build-Process rely on a certain code style.
Furthermore, it will improve code quality in your team. If everybody is familiar
with these guidelines, code will look like it was written by one single person. A
new team member can understand the logic behind the scenes more quickly and
more easily, instead of struggling with ten different syntax. As a consequence,
he/she will become productive even faster.

some errors may occur during the build.com/johnpapa/angular- styleguide/blob/master/a1/README. Variable Definition All variables should be defined with a var. 3. but recommended instead of double quotes. 3. Most rules are supported. Here. Single Quotes Not mandatory.$inject” whenever possible. We recommend to use ESLint. Semicolons It can be crucial that semicolons are set.1.2. Using a Linter Using a Linter will help you taking care of some of these rules. how explicit dependency injection can be done. although JavaScript does not require them all the time.Code Style Guidelines 13. following these guidelines should be seen as mandatory! 3. or even while the execution! Therefore. Further reading: https://github.3. There are several possibilities. Code Style In order to work properly. let.2016 IoT Moving Assets – PoC Development 3. While mangling the code (minify/uglify) the service name will get renamed and break your app.4.angularjs. If your code is not compliant to the rules.5. we will use the property annotation “.org/guide/di 3.eslintrc” files which contain the configuration compliant to these guidelines.md . as there are already existing “. const.07. Inline array annotation should be avoided! Further reading: https://docs. several tasks in the Grunt Build-Script rely on certain code style rules. Dependency Injection Do not use the implicit annotation for dependency injection. … keyword! 3.