What are Coding Standards

20 Sep 2022

Poor Code Written Well vs Good Code Written Poorly

It has been more than three years since I first began coding. My first line of code was written in C, and while I was excited to begin coding, it came with all of the trials and tribulations of learning a new language. One thing I learned over the years that has not been taught to me until now, is coding standards, which ensures proper grammar for a programming language. Consider a paragraph of a story written in English. Even if all the words were spelled correctly and the words themselves make sense, if proper grammar is not present, then it is hard to understand. The same logic can be applied to programming as well. If your code works properly, but coding standards are not applied, no one will understand what is happening and how it works, making it harder for changes to be made. On the other hand, if code does not work but is written using coding standards, it will be easier to identify the problem and work towards solving it. One such useful coding standard are naming conventions. Naming conventions allows programmers to distinguish what are variables and functions. Without it, confusion and pandemonium would incur as variables and functions are mixed up causing countless errors. Perhaps the most important coding convention however, is documentation through comments. Comments allows the developer to explain what their code is meant to do and the purpose of each line of code, allowing anyone who views their code to easily understand what is happening. This, and other coding standards allow poor code written with coding standards to be understood and improved upon unlike good code written without these coding standards.

ESLint with IntelliJ IDEA

Using ESLint with IntelliJ IDEA has been a godsend compared to previous Integrated Development Environments (IDEs) that I have used. Its ability to detect and automatically correct warnings and errors before compilation has made it much more easier to program since you don’t have to worry about these yourself. This has saved me countless hours from menial tasks such as fixing syntax errors, adding missing colons, and doing code checks before compilation. One other useful feature of ESLint is it checks if certain variables and functions are ever called or in use. This makes sure that there are no useless lines of code and that names are properly spelled. While I have just started using ESLing with IntelliJ IDEA this past week, its benefits over my previous IDE have already saved me a lot of time and I plan to use it for the foreseeable future.

Takeaways

Programming is just any spoken language, it must be written properly according to a standard to be understood. Coding standards allow developers to share their work knowing that other programmers are able to understand what was written. ESLing with IntelliJ IDEA has allowed me to easily conform to a coding standard without much thought and effort, as this has already been handled by the IDE, allowing me to focus more on the problem at hand instead of trying to correct minor errors. Using a good IDE is one way to conform to a coding standard and is important to make the most use of your time as a programmer.