Mark Needham

Thoughts on Software Development

The value of naming things

with 6 comments

Nikhil and I were discussing some of the ideas around Test Driven Development earlier in the week and at one stage I pointed out that I quite liked Bryan Liles’ idea of ‘make it pass or change the message‘.

Bryan suggests that when we have a failing test our next step should be to make that test pass or at least write some code which results in us getting a different error message and hopefully one step closer to making the test pass.

As I described this to Nikhil he pointed out that this is probably what most people are doing anyway and now the technique just has a name.

I think this is probably a fair assessment but then again I find it very useful when people give a name to common techniques/patterns as it makes them much easier to talk about without having to fill in a whole load of context.

For example Joshua Kerievsky has come up with some names to describe incremental refactoring techniques such as parallel change and narrowed change.

Parallel change describes a technique where we want to change a method signature but don’t want to break all the clients of that method by directly changing it.

Instead we create the new method alongside the current one and gradually move the clients to call the new one instead. When they’ve all moved we can delete the original method.

Narrowed change describes a technique where we try to reduce the number of places where we have to make the change we want to make.

It’s much easier to use the vocabulary that Kerievsky has come up with than to have to describe the techniques each time!

However I do think it is possible to go too far with naming things to the point that there are actually so many names that it’s incredibly difficult to remember them all.

xUnit Patterns seems like an example of this to me.

There are an incredible number of patterns described in that book and while they do all describe slightly different scenarios I’m not necessarily convinced that having this many different patterns makes our discussions easier.

Overall though I think having names for common patterns in software development is a good thing and it does add value even though it seems like we’ve just ‘given something a name’.

Written by Mark Needham

July 31st, 2010 at 7:05 am

  • http://www.orfjackal.net Esko Luontola

    At http://www.infoq.com/presentations/responsive-design Kent Beck has categorized his strategies for making changes into four categories: leap, parallel, stepping stone, simplification. And as he mentions, the strategies are scale free.

    The mention of xUnit Patterns reminds me about the terminology cross-reference at http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html Whatever the names are, it would be nice for them to be used consistently.

  • Pingback: Tweets that mention The value of naming things at Mark Needham -- Topsy.com

  • http://alexandregazola.wordpress.com Alexandre Gazola

    Cool!

    Despite the proliferation of names, what do you think of the book xUnit Patterns?

  • http://www.markhneedham.com Mark Needham

    @Alexandre – in general it’s an interesting book – more a reference book than one you’d read cover to cover though.

  • http://www.markhneedham.com Mark Needham

    @Esko – yeh I like that presentation as well. It seems like there’s quite a bit of overlap between the thoughts of Kent Beck & Josh Kerievsky.

  • http://moleseyhill.com mat roberts

    I too was disappointed with xUnit patterns…