The Icing on the Cake

26 Sep 2019

Having experience with coding for the past few years, there was always a standard that I, and many other programmers, have to adhere to. While it is easy to ignore, and quite frankly, more comfortable to dismiss, we always need to follow a certain template whenever we write our code. We programmers have the follow the guidelines of Coding Standards. On the surface, coding standards might be viewed as the one thing only nitpickers and perfectionists only care about. Making sure that each line is indented with proper amount of spaces, ensuring that the methods in a for-loop are enclosed with curly braces, or replacing the usage of var with const or let in JavaScript – these are all the typical rules within the standards. Although it might seem humbug to follow, I see it as a tool for improving my skills as a software engineer. To visualize my understandings, let us compare the process of writing code to baking a cake.

I have never baked a cake in my life, mind you, but I for sure know what one looks like and what one is made of. Basically, a cake is no more than a simple, delicious structure made of sponge cake or any other base, decorated with appropriately matching icing. The sponge cake is usually layered with multiple tiers, covered all around with a moderate amount of icing. In some cakes, there may be additional layers of icing in between each layer of sponge for added presentation. Shifting the focus back to JavaScript, or coding in any language for that matter, I think that typing in the editor window is like backing and structuring my cake. I layer my “cake” with its necessary components like its classes, functions, objects, methods, variables, and so on. True craftsmanship in coding takes practice too, much like it takes practice to know how to bake cakes so that it stays up and it tastes good. In the end, all of the layers come together to form a cohesive, working project or assignment.

However, this cake is still not finished without its icing. Surely, such a cake would still taste sweet because the sponge cake never changes. A lack of icing would result in a boring, naked cake, which would surly look unappealing to try and offer to people. All the effort might as well go to waste if no one is going to eat the cake, right? As a software engineer, it is important to have code that is readable for other users to understand and properly collaborate on your work. This is where ESLint, the IntelliJ check style, offers help for software engineers.

ESLint helps recognizes any errors in the source code that violates coding standards and promptly notifies the user with red flags at every violation. In a sense, this tool helps to uniform our code so that it would look presentable on all formats and devices, to any user who may come across and view it. Believe me, code is truly easier to digest with simple, readable syntax of effective usage of indentation, and even minute details of having white space between parentheses. Not only does it help with visual presentation, it also provides useful checks for functionality of code. It may also notify the writer if a previously declared function was not called, or if any function parameters were never used. Essentially, ESLint was the icing on the cake that allowed it to look presentable, to produce more coherent source code and ensure that it runs efficiently.

Although it was tedious to comply with ESLint’s strict coding standards, much less enabling the code quality tool in the settings of each project, it was fundamental for me as a programmer. Allowing myself to write more uniform code also helps me to debug my code as the coding standards organize what I wrote by functionality. I have worked with similar check styles with other IDE’s such as Eclipse, so this concept was nothing new. I believe that every software engineer should adhere to coding standards and perhaps a code style checker to assist in checking for errors automatically. Ultimately, collaboration between users would be more effective with everyone operating with uniform code; we could write the most pristine code – we could bake the finest cakes!