Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Gary,

I've been hoping that you would write an intelligent response to DHH's latest articles and talk ever since I saw them, thank you for doing it.

I suspect that his claims of TDD isolation damaging the integrity of designs are mostly red-herrings too. I know they are for me personally -- in fact, the opposite is true. I'd love to see you address this issue as well. In particular, your thoughts as they relate the technique of moving logic completely out of controllers (as you do in raptor). This technique seems to infuriate DHH in the context of rails, while to me it seems a far superior design.



I suspect that his claims of TDD isolation damaging the integrity of designs are mostly red-herrings too. I know they are for me personally -- in fact, the opposite is true.

I'd be interested to see more examples of that. In my experience, this sort of warning genuinely isn't a red-herring - I've worked on several projects that have been seriously creaking under the weight of test suites, and in which the desire to isolate units in particular has led to both poor code architecture, and ironically poor tests.

In particular, your thoughts as they relate the technique of moving logic completely out of controllers (as you do in raptor). This technique seems to infuriate DHH in the context of rails, while to me it seems a far superior design.

Raptor's design is interesting, but I dispute that the entire "C" in "MVC" is worthless. I agree that such is often misused, but something like Raptor essentially pushes the logic that it's OK to have in a Rails controller into the router, and I'm not sure that would actually be scalable in practice.


In fairness, I believe there exist code bases with a fragmented, poor design and lots of unit tests. I would place the blame with the programmer's design skills, though, and not with scrupulously testable, loosely coupled modules.

I do not believe that TDD is a replacement for good design skills at all, and it's easy TDD yourself into a poor design. Even strong TDD proponents like Uncle Bob admit as much [1]. However, I also believe that most good designs do happen to have the property of being easily unit testable, and if your code does not have that property, you should take pause.

[1] http://www.infoq.com/interviews/coplien-martin-tdd, point 5 in the transcript


I've experienced (and created) exactly those weighty, oppressive test suites. I think that they're probably more a symptom of us collectively learning to test than anything else. Even today, there are very few people who are experts at test isolation; five years ago there were almost none.

It's tempting to give up in situations like that, but I like to think back to "GOTO Considered Harmful". It was contentious at the time! There were people who literally thought that you couldn't build complex software systems without GOTO. It's a reminder that we always underestimate how good we can get at something, and how much freedom we'll have after adopting a constraint.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: