MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/30hyan/airbnb_javascript_style_guide_a_mostly_reasonable/cpt4lhl/?context=9999
r/javascript • u/mrkipling • Mar 27 '15
158 comments sorted by
View all comments
3
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 :) 19 u/Asmor Mar 27 '15 Also, using spaces for indentation instead of tabs.You can have my \t when you pry it out of my cold, dead hands. 3 u/eridal Mar 27 '15 TL;DR: using tabs right requires more effortYou can use tabs, but it please take care of using them in the right place: only for "tabulate", not to "align" code .. that will only work on your screen.Let me show an example:$(ctx).click(function() { $(this).attr(...) .css(...) ; });and now how to properly indent with tabs$(ctx).click(function() { →$(this).attr(...) →·······.css(...) →·······; }); 1 u/cresquin Mar 28 '15 let me get to that piece of code:left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow
38
Yes - they suggest a tab indent of 2 spaces instead of the obviously-correct value of 4. Hence, mostly reasonable :)
19 u/Asmor Mar 27 '15 Also, using spaces for indentation instead of tabs.You can have my \t when you pry it out of my cold, dead hands. 3 u/eridal Mar 27 '15 TL;DR: using tabs right requires more effortYou can use tabs, but it please take care of using them in the right place: only for "tabulate", not to "align" code .. that will only work on your screen.Let me show an example:$(ctx).click(function() { $(this).attr(...) .css(...) ; });and now how to properly indent with tabs$(ctx).click(function() { →$(this).attr(...) →·······.css(...) →·······; }); 1 u/cresquin Mar 28 '15 let me get to that piece of code:left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow
19
Also, using spaces for indentation instead of tabs.
You can have my \t when you pry it out of my cold, dead hands.
3 u/eridal Mar 27 '15 TL;DR: using tabs right requires more effortYou can use tabs, but it please take care of using them in the right place: only for "tabulate", not to "align" code .. that will only work on your screen.Let me show an example:$(ctx).click(function() { $(this).attr(...) .css(...) ; });and now how to properly indent with tabs$(ctx).click(function() { →$(this).attr(...) →·······.css(...) →·······; }); 1 u/cresquin Mar 28 '15 let me get to that piece of code:left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow
TL;DR: using tabs right requires more effort
You can use tabs, but it please take care of using them in the right place: only for "tabulate", not to "align" code .. that will only work on your screen.
Let me show an example:
$(ctx).click(function() { $(this).attr(...) .css(...) ; });
and now how to properly indent with tabs
$(ctx).click(function() { →$(this).attr(...) →·······.css(...) →·······; });
1 u/cresquin Mar 28 '15 let me get to that piece of code:left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow
1
let me get to that piece of code:
left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow left-arrow
3
u/brotherwayne Mar 27 '15
Mostly?