does anyone feel that reading other people's JS code is like reading someone else's handwriting?

Where I used to be, I built all the style guides, naming conventions, etc., basically I was the CTO. Now I'm at a startup that has some of the weirdest naming conventions, but has one good thing - we rely on whatever languages idioms, where they don't have a predefined way of doing things we use our own.

Here's an example:

**CSS / Sass / Less**
.style-u-what-it-does { 
    style: styles;
    style: styles;
}

vs

**CSS / Sass / Less**
.what-it-does {  style:styles; style:styles; }

Notice, the first example is much more meticulous. Has spaces after the colons, says in the name that it's a utility (u), breaks styles into lines. The second way has none of it and is single lined.

The first way is about making it really easy to read and explicit, the second way is about reducing the amount of time it takes to get to your spot in the code (less scrolling) and is designed to allow for mistakes.

We can see that in the different way of writing js.

**JS / Coffeescript / ES6**
const ALLCAPS = '';
let camelCase = '';

vs

**JS / Coffeescript / ES6**
const camelCase = '';
let camelCase = '';

The first way says that global constants are all caps, everything else camelCase. The second way just says camelCase for everything.

The first allows you to know what type of data you're dealing with, the second just tells you "this is javascript." The first is designed to reduce thinking when looking at the data, the second is designed to reduce thinking when switching between languages (python/php would be under_score_naming).

These are two legitimate philosophies. They both provide advantages and have disadvantages. When I'm in charge, I prefer less thinking at the beginning of the development cycle, but I understand the need for adding a little to that at the beginning to reduce confusion later on.

So what I'm saying is that while to you it may feel like handwriting, there are underlying reasons. Looking at a lot of styling is good for when you're in charge at some point, because you'll have experience in knowing what made things easier and quicker for you, versus what slowed you down.

/r/javascript Thread