+ 2

Javascript Style Guides

I haven't really written tonnes and tonnes of Javascript code yet, so I may not have any habits. Maybe I do. Anyway, I know consistent style is quite important and I also know that in the realm of Javascript that there are a variety of style guides used. I've stumbled upon a few. Google's: https://google.github.io/styleguide/jsguide.html AirBnB's: https://github.com/airbnb/javascript This Guys: https://github.com/rwaldron/idiomatic.js/ Anyway- my question is just what is recommended? What do ya'll do? I want to get in a habit of writing consistently according to some kind of standard. Quick Edit: I know about linters - like ESlint and JSlint. I have VSCode. I think that knowing what those kind of linters are looking for is better than always guessing though.

30th Mar 2018, 7:00 AM
dCook
dCook - avatar
2 Réponses
+ 1
Hi dCook Good list of resources. Idomatic js in particular a great read. As this subject can get quiet heated, the answer is normally choose the one you like and go with it. Of course if your plan is to get a job with Google or AirB&B you know which one to choose. I think ESLint is now the preferred Linter and having this inside your editor really teaches you a lot about coding.
30th Mar 2018, 8:20 AM
Mike Choy
Mike Choy - avatar
0
Thanks @Mike Choy that’s some nice feedback. I browsed a bit of idiomatic before and it’s quite nice. He makes some great points right off the bat. I’d like to keep reading that all the way through. You are right that this topic gets quite heated. I am not one to say this one is better than that one. That’s all preference and preferences are very personal. Sometimes it’s the preference of a company or a project leader. I feel it’s quite unfortunate that there is no standard that everyone adheres to. It can just lead to wasted time!
30th Mar 2018, 9:36 AM
dCook
dCook - avatar