Shouldn’t be forgetting for one off scripts either, if that’s the logic you want to go with.
The tool exists, either you do it or you don’t and end up getting an error until the interpreter hits that line. It’s just the nature of being compiled at runtime.
TDD only works well if the problem is clearly specified before the first line of code has been written, which is rarely the case when I need Python for something.
My brother. That’s why you do unit tests.
And lint
👆 definitely linting first 👆
finding errors as you type is even better than finding errors at compile time
I shouldn’t need to do unit tests for quick one off scripts
Shouldn’t be forgetting for one off scripts either, if that’s the logic you want to go with.
The tool exists, either you do it or you don’t and end up getting an error until the interpreter hits that line. It’s just the nature of being compiled at runtime.
“Ohh, I got all these numbers I want to crunch using numpy or pandas and plot it using matplotlib. Hold on, I just need to write unit tests first.”
Well. Yeah. That’s test-driven development. It’s a very good practice.
TDD only works well if the problem is clearly specified before the first line of code has been written, which is rarely the case when I need Python for something.