[LRUG] Dependency Injection and DHH

Gerhard Lazu gerhard at lazu.co.uk
Mon Apr 28 16:27:32 PDT 2014


Some fantastic replies, really proud to be part of such a well-rounded and
experienced Ruby group.

Unlike other times, DHH did a really good job explaining his controversial
viewpoint this time around. Most of his keynote is about why he is the way
he is, and if you pay close attention to the first part of his Keynote, it
all makes sense. The truth is that he is right, and even though "his right"
is at opposite ends to "our right", look at where his "programming
motherfucker <http://programming-motherfucker.com/>" approach got him (ie
Rails, 37signals etc).

The more experience I gain, the more I realise that there is no one true
way. I was on teams that didn't even know about TDD, others that were truly
infatuated with it and were living proof that too much of a good thing is
counter-productive, and others that did TDD just to tick a box but never
really cared. DI is even more varied as it doesn't benefit from the same
prime spot as TDD. Both concepts attract and gravitate around one another,
it's difficult to do either on their own and gain significant benefits.

Ultimately, knowing when **not** to use TDD or DI is just as valuable as
knowing when to use them. All projects are unique, as are all situations,
and with no rules, just guidelines, it takes experience (ie many mistakes)
before the decisions that one starts making are more right than wrong.
Listen to your common sense, read and explore all the great books,
screencasts and blog posts that many bright minds have put together and
make your own choices, don't do something because DHH or Avdi Grimm said
so. Ultimately, enjoy what you're doing, otherwise you might as well be a
typewriter.

I have written logical, easily comprehensible PHP, awk and bash code with
absolutely no TDD. A lot of it is still ticking in production, going on 8
years, still making money for its owners, getting the job done. If code
could laugh and tell stories, those would be happy codebases. I have also
written Ruby with all the TDD, DI and BDD that any one of you would be
happy to take over and continue adding new features with little friction or
drag. Unfortunately, most of that code will never see real users and will
never make any money for its owners. That's what I call a "sad codebase",
and it's a real shame.

Here's to more happy codebases, happy users & happy devs, DI/TDD or not.

Gerhard



------------------------------
Twitter <http://twitter.com/#!/gerhardlazu> Github<https://github.com/gerhard>
 Blog <http://gerhard.lazu.co.uk/>


On Fri, Apr 25, 2014 at 2:25 PM, Sleepyfox <sleepyfox at gmail.com> wrote:

> I'm wondering what those who were at RailsConf and listened to DHH's
> keynote - or have watched the video:
> http://www.justin.tv/confreaks/b/522089408 - thought about his
> description of dependency injection making code worse?
>
> Fox
> --
> "What does the @sleepyfox say?"
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140429/e9e4639d/attachment-0003.html>


More information about the Chat mailing list