With software engineering as a booming industry, many people are writing code for various applications that are being used around the world. It is important to have a standard for the way we communicate with computers. Think of coding standards similar to grammar for English and other communicative languages. If you don’t follow the rules you may get your point across, but it will be difficult to understand or even unintelligible. We have these rules in place so that others can understand them. Having working code is great but having understandable code is even better.
An amazing comparison made by Professor Nayaran at the University of Hawaii at Manoa in my lecture with him is that companies spend more money on the programmer than the machines they use. He described how back in the 60s and 70s when programming languages like C were just created, machinery was inefficient. Computers could take up rooms of storage to process information and were costly. However, the price to pay the people running machines didn’t compare to that. With the rapid development of technology, the ratio between the price of a computer and an employee has completely switched. Everyone has computers in their homes and classes and business are built on everyone having access to a computer and internet. Looping back to the topic, time and efficiency are what cost companies money. The time for machines to process code now has become minuscule compared to that of a programmer trying to implement it. Back then there was no coding standard because the computer would take longer to understand it than other people. Now, since the computer is faster than the person, we have to be able to save time anyway we can. And one way is through coding standards. Having a coding standard allows for an easier sight-read of code for anyone new and revisiting a project.
The main importance of having readable code is having it understandable. In real-world applications most of the time you will not be the only person working on a project. Big projects require multiple people, so it’s important to all work off of each other. That is why readable code is important so that others can process what you wrote. Even on a personal level for your projects, when you start a project and code without a coding standard leave it alone for later. When you return to the project you probably won’t remember what you are coding if you can’t understand it. It’s also good practice to add comments to functions and files so that you can easily get back into the flow of work.
ESLint is an add-on to your IDE that marks your Javascript code based on a certain coding standard. Using ESLint imposes standards for formatting variable conventions and function conventions. My impression of ESLint is that it is a good tool to use to have all of your files in a similar and proper format. It questions everything in your code when it isn’t exactly how ESLint wants it. I overall think that it’s a good tool to have because being strict with the coding standard allows for your style to stay consistent, and hopefully you will get into the habit of following it yourself. What I noticed is that it marks everything from an extra space character after a semicolon and some others, which can lead to a large amount of marked errors on your page when your code runs perfectly fine.
When it comes to coding languages ESLint could help you learn languages but could also hinder it. There are languages where your formatting is very important. In a language like Python, its syntax is based on formatting. A program like ESLint could benefit you from learning a language like that. I think it isn’t completely positive because when you are so focused on the neatness of your code you hinder your time just learning how to code in that language. A good example is just like learning any spoken language like English or Japanese, you won’t have a complete understanding of the grammar but over time through speaking it and making those mistakes can you learn the proper way to talk. I think when learning your first language you should try to write in a coding standard but maybe not implement ESLint til you have gotten a grasp of it. Overall ESLint is like a perfectionist standing over your shoulder and pointing out all of your minor and major mistakes.
The world runs on structure and without it creates chaos, coding is no different. We can create structure with coding standards. Through it, it allows us to be more efficient in our job. Just to grab a quick number, if we had a section of code that was not clear that took an extra 10 minutes to understand, with a team of 10 people each it would take up to around a total of 2 hours when every member has viewed the program. Just entry-level pay is around $30 an hour. If a group was working on that project for one month and didn’t change it but gave the extra time to understand it, it would cost that company $1800 that month. That is just a low estimate because code can be reused throughout the year, positions could pay more than entry, and take way longer than just 10 minutes to understand. That is also assuming that your code will work, if you have broken code that is published it will cost the company potentially millions to fix. Coding standards save us time and companies money.