T
13

TIL what a 'linter' is and my code looks totally different now

For the first three months, my Python scripts were a mess of bad spacing and lines way too long. My friend finally looked at one and said, 'Betty, you need a linter.' I installed one called 'flake8' and ran it on my old project. It gave me 87 errors to fix, mostly about style. Now my code is neat and other people can actually read it. How long did it take you all to start using tools like this?
3 comments

Log in to join the discussion

Log In
3 Comments
olivia_anderson67
Took me way longer than it should have, honestly. Flake8's output can feel brutal at first, but fixing all those style errors is the fastest way to learn the conventions. Setting it up to run automatically in your editor saves so much time later. You'll start writing cleaner code by habit just to avoid the red squiggles.
1
wyatt107
wyatt1072mo ago
Flake8's output" is actually the linter. The errors it shows are from pycodestyle, which it wraps.
1
wendysmith
wendysmith1mo ago
Setting it up to run automatically sounds helpful but honestly it just trains you to fear the linter. All those red squiggles make you focus on tiny style rules instead of the actual logic of your code. You start writing to please the tool, not to make your program work better. It can really kill the flow when you're trying to solve a real problem.
4