Double indent that line

26 Sep 2024

Coding standards?

I have never really been consistent or even really gave a second thought to coding standards at all before today’s WOD and also lessons (which I sort of didn’t do). To me, it just didn’t register as that important, and I never really seeked to improve on it. After having used it today and getting firsthand experience with ESLint and VSCode, I definitely have some insight and developed some opinions on it, realizing both the importance but also struggles of attempting to learn to adjust to using them.

Learning standardization

Previously, I tended to not really think about the readability, maintainability, or consistency of my code, having left a whole lot of multiple spaces/tabs, indentations, and undspaced brackets/curly braces in my wake. Everything just sort of seemed “thrown on” to the screen. While it was pretty messy, I did make a semblance of an effort to keep the majority of new spacing and indetation that I’d write have somewhat of a resemblance to the rest of the code. However, there no effort to enforce anysort of consistency throughout, with me occasionally having extremely out of place code segments. With the usage of ESLint from todays WOD, I was first hit with the double indent spacing standard, and I immediately thought to myself “Oh boy.” I was sort of expecting this WOD to be a test of our proofreading and typo/standard fixing skills, and it seemed to be the case. However, through my struggle I found the code to be much more beautiful to read and also feld somewhat proud that my code actually looked readable.

Reflections

Looking back on some of my old code, I can see how coding standards are so fundamental to coding and software engineering in particular. Just seeing how messy and unstandardized my code was made me think of how potentially bad it could be if companies and bigger databases had no standards anywhere, or practiced any form of commenting/good coding conventions. With fragments of disheveled code across the screen, with no understanding of what it might do, I can see how a lack of structure can lead to some catastrophic effects primarily in maintenance, a very important aspect of software engineering. I will admit that while getting rid of the errors is a pretty unfamiliar and unfortunately time consuming activity, I can understand why it is almost necessary.