Coding

The Zen of confirm

The idea of The Zen of confirm is highly inspired by The Zen of Python and must be our dogma for maintainable solutions:

  • Beautiful is better than ugly.

  • Explicit is better than implicit.

  • Simple is better than complex.

  • Complex is better than complicated.

  • Flat is better than nested.

  • Sparse is better than dense.

  • Readability counts.

  • Consistency matters.

  • Special cases aren’t special enough to break the rules.

  • Although practicality beats purity.

  • Errors should never pass silently.

  • Unless explicitly silenced.

  • In the face of ambiguity, refuse the temptation to guess.

  • There should be one - and preferably only one - obvious way to do it.

  • If the implementation is hard to explain, it’s a bad idea.

  • If the implementation is easy to explain, it may be a good idea.

  • Namespaces are one honking great idea - let’s do more of those!

Python Coding Gudielines

Apart from The Zen of confirm, most of the Python coding guidelines are automatically checked by the following linters:

HTML Coding Guidelines

Apart from The Zen of confirm, the following rules apply especially to HTML:

  • Attributes use the kebab-case format.

  • Boolean attributes will not use prefixes like is…, has…, can….

JavaScript Coding Guidelines

Apart from The Zen of confirm, most of the JavaScript coding guidelines are automatically checked by the ESLint.

However, the following rules apply especially to JavaScript:

  • Vanilla JavaScript is better than frameworks.

  • ECMAScript 6 is better than their predecessors.

  • Backward compatibility is not required and can be ignored.

  • The id attribute must be used to query unique / distinct elements in JavaScript.

  • The #id selector must never be used for CSS styling.

Hint

Also have a look at the Web Components Guidelines, as JavaScript is also a part of Web Components.

CSS Coding Guidelines

Apart from The Zen of confirm, most of the CSS coding guidelines are automatically checked by the stylelint.

However, the following rules apply especially to CSS:

  • Vanilla CSS is better than Sass or Less.js.

  • CSS classes must use the kebab-case format.

Hint

Also have a look at the Web Components Guidelines, as CSS is a part of Web Components.

Web Components Guidelines

For Web Components the following rules apply:

  • Web components must only be customisable by attributes.

  • Passing CSS classes to web components is prohibited.

  • CSS selectors directly on the :host() are preferred over any layer of indirection or abstraction.

  • BEM, OOCSS, SMACSS or alike must not be used at all.

Hint

Since web components use all web technologies, HTML, JavaScript & CSS coding guidelines are also applied to Web Components.