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)
test456
test123
I don't use all but I know :
There are also DRY, KISS and PEP for standards.
Thanks for sharing, very helpful :)
ESLint & airbnb for JS (one of the best, with example & explanations)
Other languages > ~linters & unit tests
That's a lot of standards to keep track of 😆
The bigger part is to add them in your linters:
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 ;)
Do you mean a convention for any specific language? Or any language?
Any language at all!
Hmm, I mostly follow the xo style. It seems to be the perfect mix of best practices and my favourite styles
nice, thanks for sharing!