The Correct Way to Code

10 Feb 2022

How to Code Correctly

When coding, there are always certain rules we have to follow. There are different syntaxes for different languages and there are certain things you cannot do in some languages, or things that you can do better in other languages. One thing that is common across most, if not all, programming languages is that coding standards exist for each language. Coding standards are very important in order to improve code readability, improve collaboration in teams, and it also helps to find errors in your code. Coding standards provide a structure that is to be followed and by doing so, it can improve code quality and also help you in learning the language you are coding in, especially if you are someone who is new to the language.

It improves code readability by enforcing everyone to follow the same format of coding, so even if you are not the person who wrote the code, it will be written in a similar format to what you are used to, thus allowing you to be able to comprehend it in a more seamless fashion. This also ties into improving collaboration in teams, as others will look at the code you have written when you work together on a codebase. Knowing that, it is important to establish coding standards as it gives the team members an easier time reading and understanding your code so that they can also work on it for debugging if needed. Coding standards also helps with finding errors in code because it helps point out any syntactic errors that you may have in your code while also enforcing that you fix the errors relating to the coding standards which promotes a more uniform coding environment.

ESLint & IntelliJ

Experiencing ESLint

I have experienced ESLint before in the past when I took ICS 314: Software Engineering I, but since then, I have not worked much with it since I got a new laptop and I did not end up following through with setting up ESLint. Now that I have set up ESLint and have used it for about a week, I am starting to refamiliarize myself with all of its quirks. Using ESLint is something that balances the fine line between painful and useful. It is painful in the sense that there are many small things I find myself correcting that ultimately do not affect the functionality of my code, which is a little painful as it makes me go back through and fix those tiny details. However, it is quite useful in the sense that it points out these flaws which possibly lead to errors that can be found in the code. It also provides a more organized space to write code in and that allows me to write code that follows a format that I can understand and read well. The big thing in ESLint is attaining the green checkmark, which is a symbol of completion, and it shows you that you have successfully completed your code to that point and followed the format correctly. It is a symbol that must be worked hard for but in the end, it is quite rewarding as it symbolizes completion and that you have no errors in your code, as far as ESLint is concerned. Knowing all of this, I can safely say that even though ESLint is somewhat painful, it makes up for that with how useful it is.

Interacting with IntelliJ

Since my ICS 314: Software Engineering I class, I have still used IntelliJ during that time as one of my primary IDEs and I can say that I am quite satisfied with what I get out of IntelliJ. It is able to satisfy all my coding needs and provides a nicely organized environment for me to code in. There are lots of useful shortcuts that come with the IDE, and though I will admit that I do not take advantage of as much of them as I should, the ones that I do use are especially useful. One notable example I can think of is cmd+opt+L which is used to format code based on the coding style that is used. This shortcut allows code to be reformatted automatically so that the user does not have to manually do everything themselves which saves a lot of time, especially if there are many reformattings that need to be done. I have also used IntelliJ for coding other projects, and one notable example would be for my Master’s project. When working with that codebase, it contains more files and more code than I had typically worked with at the time, but IntelliJ made it easier to have things sorted and to see where everything belonged. This ultimately made it easier for me to know where I needed to code and what the purpose was for each section of code. Overall, I would say IntelliJ is a great IDE to use and I will continue to use it throughout my career.