r/javascript • • Mar 27 '15

Airbnb JavaScript Style Guide - A mostly reasonable approach to JavaScript

https://github.com/airbnb/javascript/blob/master/README.md
315 Upvotes

158 comments sorted by

View all comments

3

u/brotherwayne Mar 27 '15

Mostly?

38

u/mrkipling Mar 27 '15

Yes - they suggest a tab indent of 2 spaces instead of the obviously-correct value of 4. Hence, mostly reasonable :)

2

u/DaemonXI Mar 27 '15

Normally I like four spaces, but JavaScript is so heavily nested with callbacks that I think using two spaces actually makes the code more readable.

0

u/[deleted] Mar 27 '15

[deleted]

2

u/wdpttt Mar 27 '15

Are you serious? Why that?

0

u/[deleted] Mar 27 '15

[deleted]

4

u/eridal Mar 27 '15

well he's trying to say that it does not make much sense as (1) functions are values, (2) variables can reference functions, and (3) variables and functions declarations share the same namespace