Become a pedantic coder
Tags: webdev, programming, cleancode, productivity
Published: 2024-01-27 18:22:07

Recently I was doing some DevOps stuff and took the chance to add an instance of SonarQube to the CICD pipeline I was improving upon.

In doing that I took the time to read all the rules they have for the languages we use: JS/TS.

## ${insertLanguage} is way worse than you think

Yes, Javascript can do some awful stuff… and it’s even worse than you know it.

Reading the rules led me to learn so much about JS. Yes, most are things that you should not do that I never imagined were possible, but still… by learning that, you learn why and what happens, and then you get to learn some “insides” and APIs you would probably never know otherwise.

I recommend a look at: https://rules.sonarsource.com/javascript/

But this led me to look at rules for other languages, also for other linters rules.
So let me tell you: this reinforced my disbelief that we can have any working piece of software.

While some things are just nitpicks, even those are important to maintain consistency.

But security, accessibility, or even “suspicious” implementations that might not be or do what you’re expecting is what those linters shine.

## Why be a pedant?

As programmers, we can’t really agree on basically anything but on a team? That’s one place you need to set rules and abide by them.

When starting out, you can add rules as you go or, if possible, start in the most strict way possible and then let go of rules that don’t make sense.

This is where a pedantic coder enters because they already know things they like and don't like, sometimes with lengthy explanations for each of the rules, even the most trivial ones.

A good pedantic can then impose in a team without any rule some order, and then be able to acknowledge that some of the rules might not make sense for the team or project.

## You must know the rules for when you need to break them

In another post, I highlighted that [“Junior need rules, senior guidelines”](https://dev.to/noriller/junior-need-rules-senior-guidelines-55ma), but in general, as far as the hard skill of coding goes, everyone needs those rules. No one can keep everything and even more things they don’t know about in mind when coding.

Which is why… ["I’m stoopid! So I code in “easy mode”](https://dev.to/noriller/im-stoopid-so-i-code-in-easy-mode-48dg?comments_sort=top), and to make an example… just about now I was creating some dotfiles and it wasn’t working no matter what I did… It was supposed to be something simple, create, start program, and go… then I realized it was a simple typo! In a feature-rich IDE, it would probably gently remind you that you might have meant something else, and for files, icon themes can let you just glance and think it would be weird that the icon isn’t what you expect.

We, as humans, are awful for those “simple” things! So let those tools tell you everything that might give you grief later and keep your efforts into those that need you actually break those rules, take the reins, and do what you need knowing exactly what you’re doing and why.

## Not zero, not too many

If everyone or no one were pedantic then it would, most likely, just create chaos since everyone just does what they want.

It’s not something for everyone, it’s also not an easy role to fill and it’s something that might become just some white noise in the background of the programming you do, after all, most things can be automated, and people learn to avoid the squiggly lines with time… errors and bugs just don’t happen as often… but from the zero to that, it’s the hardest.