For me, programming is like writing an article. There are logical blocks which belong together because they describe a common thing. In between there should be blank lines.
In addition, I come languages, which usually put an opening curly bracket in a new line, so I am used to there being space. It improves overview greatly that way, but I do use some exceptions to that rule. That's why I write code, like:
/* CSS */
.c-my-component {
background-color: hsl(0, 50%, 80%);
}
.c-my-other__component {
color: hsl(0, 0%, 3%);
}
// JS
'use strict';
const path = require('path');
const fs = require('fs');
const nml = require('node-mod-load');
const defer = require('promise-defer');
const myMod = require('./myMod');
const conf = require('../config/myConf');
const foo = function () {
console.log('foo');
};
const bar = function () {
var i = 0;
const l = 10;
while (i < l) {
const str = `bar ${i}! <3`;
console.log(str);
i++;
}
};
foo();
bar();