this post was submitted on 02 Nov 2023
1389 points (98.5% liked)

Programmer Humor

31784 readers
93 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 57 points 9 months ago (10 children)

This is why you write the test before the code. You write the test to make sure something fails, then you write the code to make it pass. Then you repeat this until all your behaviors are captured in code. It’s called TDD

But, full marks for writing tests in the first place

[–] [email protected] 71 points 9 months ago (9 children)

That supposes to have a clear idea of what you're going to code. Otherwise, it's a lot of time wasted to constantly rewrite both the code and tests as you better understand how you're going to solve the task while trying. I guess it works for very narrowed tasks rather than opened problems.

[–] [email protected] 16 points 9 months ago

This is the reason I dislike TDD.

load more comments (8 replies)
load more comments (8 replies)