1053
submitted 9 months ago by stsquad@lemmy.ml to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] cyborganism@lemmy.ca 1 points 9 months ago

Well. Yeah. That's test-driven development. It's a very good practice.

[-] magic_lobster_party@kbin.social 7 points 9 months ago

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.

[-] tryptaminev@feddit.de 0 points 9 months ago

So which is then? You want a one off script to just quickly crunch some numbers on a problem you still need to understand? Because that is where it is perfectly normal to get some errors and doodle around. That is the entire point of it.

Or you have a concise concept of what you are going to do, and how and why? Because that is what you do, when you program more than a "one off".

Either you go to the store with a shopping list and you work through that list or you go browsing and see what comes up. But don't expect to be as fast and have everything you needed, when you dont write your shopping list at home.

[-] magic_lobster_party@kbin.social 1 points 9 months ago* (last edited 9 months ago)

Often I use Python for exploratory purposes. Like, I got a bunch of data, and I want to know if a particular algorithm might work or not. I implement the algorithm, but realize the results don’t look good enough. So I tweak the algorithm, maybe even do major refactoring. Or maybe I realize my visualizations or metrics don’t capture what I need to see. Or maybe I must settle for some compromise?

I iterate on this repeatedly until I find something I’m happy about (or until I give up). Sometimes I end up with something completely different from my initial idea.

TDD won’t help me much here because the end result is unknown. For each iteration of this idea process I might even need to rewrite all the tests because none of them are valid anymore.

[-] tryptaminev@feddit.de 1 points 9 months ago

in this process it is just normal to get runtime errors. Your expectation is too high imo.

[-] rambaroo@lemmy.world 1 points 9 months ago

TDD is not appropriate for everything or everyone

this post was submitted on 02 Feb 2024
1053 points (98.3% liked)

Programmer Humor

32415 readers
638 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS