r/javascript • • Apr 01 '18

Google publishes a JavaScript style guide. Here are some key lessons.

https://medium.freecodecamp.org/google-publishes-a-javascript-style-guide-here-are-some-key-lessons-1810b8ad050b
714 Upvotes

317 comments sorted by

View all comments

34

u/seands Apr 01 '18

What do you guys think about the spaces over tabs? For me, I tend to make more mental mistakes and spacing errors with 2 spaces. Tabs make everything clearer to me.

4

u/Kerse Apr 01 '18

I prefer spaces because it tends to copy nicer if I need to copy + paste a code snippet onto stack overflow or something.

1

u/Disgruntled__Goat Apr 02 '18

Copy-pasting tabs works perfectly fine on SO. And if everyone uses tabs everywhere, including displaying code, you could more easily copy-paste it from SO into your editor without having to worry about 2-space vs 4-space etc.