DEV Community

Discussion on: I'm Sandi Metz, Ask Me Anything! [Finished]

Collapse
 
sandimetz profile image
Sandi Metz • Edited

Andrew, this is my pleasure.
Ah, TDD. I find my code turns out better if I write tests first, but I am deeply sympathetic about how hard that can be. Writing tests first can help drive you to create decoupled code. If you write tests 2nd, and then find that the tests have complicated setup, this suggests that your code is too tightly coupled together. If you write tests first, and insist on having simple setup, you'll naturally end up with nicely decoupled code.

Collapse
 
restoreddev profile image
Andrew Davis

That makes sense, thanks!