DEV Community

Cover image for Do you follow any coding conventions/standards?
Fum for Inspirezone Developer Community

Posted on

Do you follow any coding conventions/standards?

Coding conventions provide guidelines on how code should be written for a particular programming language to allow best practices and consistency in programming style.

I’m forming a list of coding conventions by programming language and wanted to find out if devs here use coding conventions at all and if you do, which ones? Also, Are there any industry specific standards you follow?

I work with embedded C and my industry doesn’t have any coding standards that must be strictly followed as such. However, if I wanted some guidelines I tend to use a standard called MISRA C (Motor Industry Software Reliability Association) as a reference because it’s widely recognised in the embedded space.
Although, admittedly most of the time I’m simply using my own idea of best practices from past experience!

Top comments (12)

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!