Code Readability

#1

Pub Wizards,

As I am going through this journey learning JS, I would like to know what you guys think is a good guideline for code readability, I just want to build a good foundation for myself. I also understand the whole gist of readability and shitty one liners with lazy variable naming, and it really depends on your team you work with, but I just wondering if there was a professional standard that noob should emulate. So far with my research I have found a liking to Airbnb though i do not wish to try to work for them.

Let me know what your thoughts are :beers:

2 Likes
#2

One thing that I would like to mention is that if you are using vscode as an editor, you can add the eslint extension and integrate the eslint Airbnb style guide. This will allow the editor to show you where you should improve your code style, and if you wanna be more like a pro you can make it so that vscode fixes code style automatically on file save. (I could explain how to do that if you want). From what I’ve seen at the company I work at, the Airbnb style guide is a pretty good standard. Obviously you don’t need to follow it to the Letter you can definitely make amendments for yourself. Example: Airbnb prefers that you don’t put () in a anonymous function with only one argument, if you think that makes your code more readable with () then add them, etc .

3 Likes
#3

thanks man i already have esLint installed! I just wanted opinions on AirBnB, but yeah thats the response I am getting from most people.

3 Likes
#4

Get prettier installed globally and set the “prettier.eslintintegration” setting to true and watch the magic happen.

3 Likes
#5

got that too and quokka/code runner :grin:

3 Likes