Comment

Comment by naikrovek

> Good programmers gravitate towards shorter lines of code by nature. If your average line of code is wider than 80 characters, it's likely you have some other, bigger coding style problems which need to be addressed.

This kind of thing is really obtuse and it drives me insane that so many people subscribe to ideas like these.

This kind of thinking is what leads to linters with completely arbitrary rules telling me how I should solve my own problem.

Me: "Hey linter, I'm going to shadow a variable name here, because that's the right thing to do in this situation, so shut up about it."

Linter, and 5 billion HN commenters: "you're shadowing a variable. Compile warning."

Me: "it's a language feature, and it's ok to use."

Linter: "you're shadowing a variable. Compile warning."

Etc.

Arbitrary rules like line width (and I assure you, those rules ARE arbitrary) help exactly 0 people per day, and cause problems for more than 0 people per day.

I PROMISE that a human brain is better at discovering general code quality problems than the best linter with the best rules, and that will be true until a time when every reasonable computer is a general purpose AI.

Yes, tell me when I have a memory leak. Use static analysis to tell me about weird issues I have difficulty seeing. I know best about line width and how to solve things in my own application better than any linter could ever hope to, because linters do not have anything approximating the intelligence of gnat, nevermind a human being.

parent naikrovek 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton