Hacker News new | ask | show | jobs
by crabbone 945 days ago
> increases productivity to not have to double check each and every instance of violating a lint error,

At what cosmic speed should you be pumping out code for this to be a concern?

Also, in C#/.NET, where programmers predominantly use MSVS, which is an atrocious editor with MSBuild, which is an atrocious build system, both hampering productivity...

Also, plenty of linter errors are actual errors that need non-trivial fixing. So, I struggle to understand how that may be automatically fixed (at least in the context of Python). A trivial example: misspelled variable name -- how would the linter know if that's a typo, or that the programmer intended to declare this variable, but forgot to do that?

2 comments

> Also, plenty of linter errors are actual errors that need non-trivial fixing.

These sound like they're not lints at all.

No, not really. It is perfectly possible to write unintentionally valid code, which would be caught by linter due to the author not following some convention.

Trivial and popular example of such code is assignment instead of comparison in the context of condition. Some languages allow for this to happen, but it's known as a possible mistake and so the conventions in such languages would discourage the use of assignment in the context of condition, even though it technically produces valid code.

It's very useful for multiple scenarios: 1. Learning new syntax. E.g. the new switch expressions are pretty neat and better than the old switch statements. Changing and learning how to write them is super easy thanks to this feature.

2. A code base with less then good practices is vastly easier to adjust to better standards than in python. I've done both and dotnet is mostly applying suggestions and then looking for more advanced problems which where not caught by automatic analysis. It's not perfect, but it reduces useless churn.

This also holds true for rider and vs with resharper.

And VS Code too with the analyzers that come with the sdk! (or numerous others that are available as extensions e.g. Roslynator)