Coding with Style

19 Sep 2017

While programming, most coders don’t acknowledge the placement of white spaces, curly brackets or any type of proper coding format. This is sufficient for personal projects, but what if you want to share it with other people? Will they be able to understand or read your code? This is where coding standards come in. Having well structured code makes one’s code readable and organized. Coding standards may also help with learning a new programming language due to the readability of the code. When the code is structured, it’s easier to recognize certain concepts and see how everything fits together.

ESLint along with the integrated development environment (IDE) Intellij enforces these coding standards and will notify you when a line of code has an improper format. I’ve always liked a well formatted code, but when time is a factor, it goes out the window. Having ESLint forces me to address improper coding standards and has certainly helped me write well structured code, although becoming comfortable with it will take some time. The first few times I used it, I found myself concentrating on the ESLint errors, rather than trying to figure out how to solve the problem. As time went on, those errors were put on the backburner and I developed the habit of writing formatted code to the ESLint standards.

Although using ESLint was frustrating at times, my code looked ten times better. It dramatically helped with debugging. When the code is structured correctly, finding errors become a breeze. Looking back, I wished I learned coding standards from the beginning. It would have eliminated frustrations like finding where the missing close-curly-brace went or which nested for-loop a line of code belonged to. Coding standards promote the development of readable and understandable code, which is very important for software engineers because we usually work in teams. Everyone should adapt coding standards and code with style.