DEV Community

Cover image for Do you follow any coding conventions/standards?

Do you follow any coding conventions/standards?

Fum on June 04, 2021

Coding conventions provide guidelines on how code should be written for a particular programming language to allow best practices and consistency i...
Collapse
 
funbeedev profile image
Fum

test456

Collapse
 
funbeedev profile image
Fum

test123

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
sabderemane profile image
Sarah Abd • Edited

I don't use all but I know :

There are also DRY, KISS and PEP for standards.

Collapse
 
funbeedev profile image
Fum

Thanks for sharing, very helpful :)

Collapse
 
youpiwaza profile image
max
  • w3c for html
  • smacss for css/scss
  • ESLint & airbnb for JS (one of the best, with example & explanations)

  • Other languages > ~linters & unit tests

Collapse
 
funbeedev profile image
Fum

That's a lot of standards to keep track of 😆

Collapse
 
youpiwaza profile image
max

The bigger part is to add them in your linters:

  • Got one in vscode
  • Got one in a dedicated task (mostly using it before git stuff) where i can get more details.

It's kinda tedious at the beginning, but very quickly it just make you code wayyy cleaner, and it become usual you don't even think about it after the first month.

AirBNB is also great for that as it clearly explains every little thing, it's mostly a DRYer/Refacto of your code ^^.

Also using them through a proper development environement (npm for front for example), through packages, makes updates a breeze ;)

Collapse
 
siddharthshyniben profile image
Siddharth

Do you mean a convention for any specific language? Or any language?

Collapse
 
funbeedev profile image
Fum

Any language at all!

Collapse
 
siddharthshyniben profile image
Siddharth

Hmm, I mostly follow the xo style. It seems to be the perfect mix of best practices and my favourite styles

Thread Thread
 
funbeedev profile image
Fum

nice, thanks for sharing!