We don't need human linters

on erock's blog

If a robot doesn't complain then you shouldn't either

Code reviews are difficult. Reading code is much harder than writing code. Every organization I've worked at required code reviews. Does every single code change require a code review? I think they are overrated, but I'll save that for another post.

After working at startups for the better part of a decade, I've noticed a couple trends by code reviewers -- myself included.

I have a pretty harsh stance on code reviews and code style requests in general: if a robot doesn't complain then you shouldn't either.

I think it's an incredible waste of time to focus human labor on scanning a code change for style, linting, and internal consistency.

But what happens when a robot cannot detect or automatically fix a code style we want to enforce? Simply, stop caring about that code style. Again, this is a tough pill to swallow but I'd like to reinforce the notion that code style and many lint rules are preference that have no material impact on how the program works.

If you really care about a code style, spend the time you normally spend scanning for it and instead automate it.

The really important lint rules -- the ones that actually prevent bugs -- can all be automated.

This mentality of offloading work to a robot feels critical now more than ever. Robots are going to be doing more and more of the mundane tasks humans are currently doing. We need to shift how we use our labor to things that are high impact and things robots cannot do for us.

Have a comment? Start a discussion by sending an email to my public inbox.