Balance to Everything

23 Sep 2021

Legible vs. Non-legible Code

Here we have examples of 2 different styles of codes that do the same thing. One is clearly easier to read and understand than the other. Although this code is quite simple, if this manner of style continues onto a bigger project we will get to a point where possible errors and legibility will take an excruciating amount of time leading to inefficient and bad programming practice. This is where coding standards come in.

Bad Coding Practice
let NUm = 1; let suM =0;
for(var inC =0;
inC < 100; inC++)
{
    suM = suM + NUm;
} console.log(suM);
VS. Good Coding Practice
let num = 1;
let sum = 0;

for (var i = 0; i < 100; i++) {
    sum += num;
}

console.log(sum);

Importance of Coding Standards

Coding standards help us clarify to the reader the format of the code. These miniscule details in each and new line help save time when it comes to understanding how the code runs. Not only will you learn how to write more efficient code but also have better results in doing so. I believe that in doing this you will not only improve on your skills but also become a better programmer while doing so.

Asking a question in a “smart way”

After coming upon and using ESLint with IntelliJ this past week I’ve come to realize the balance and duality that comes with using these programs. My initial impressions are that the interface is quite simple to use and I like how we can go quickly in between IntelliJ and GitHub. I also enjoy the fact that ESLint notifies and lets you know the errors that exist in the code we write. This is very useful and I like the fact that we can also learn from our mistakes because of this. However, there is usually a balance to everything and the good also comes with the things I don’t really enjoy. I find it very painful when I receive an error that’s not a typo nor format issue. I find it very hard to click on the error icon to see what my mistake was, sometimes having to click at least 3-4 times in order to get a statement. However, overall I think that these programs offer great utility towards coding standards and I believe that it is a great addition to my set of tools I can use for programming.