Cleaner code in other languages » IMG_1274

IMG_1274
IMG_1274.jpg

6 Responses to “IMG_1274”

  1. Frank Shearar Says:

    Does the writer mean that using the test to drive development is a bad thing? Why?

  2. Willem Says:

    The writer didn’t mean using the test to drive development is bad per se. What happened in this case, was that the pair started off from an end-to-end test, and spend until beyond the end of the session to make the entire test work. In hindsight they found that it might have been easier to write some microtests as well, and make them green one by one.
    The word ‘debugger’ appears on the flipchart, because in smalltalk it is possible to write code and add methods from the debugger. Modern smalltalk environments have a ‘create method’ button in the debugger that enables you to create a method if running code fails because of missing methods. So in this case, the pair spent the entire session after they wrote the end-to-end test in the debugger.

  3. Frank Shearar Says:

    Ah OK. Because I _like_ using the debugger just like that – write a test, run it, watch it fail, step through to the right place, add sufficient behaviour for it to pass, and hit “proceed”.

    I’ll say “amen” to the idea of writing small tests too. I find it psychologically satisfying to get and keep a green bar; in contrast, a test that really makes me work to get it to run always leaves me feeling drained.

    (By the way, your stylesheet’s making your comments (or the odd-numbered ones, assuming a 0-based index) difficult to read: the text’s white on a white background. Or perhaps it’s just )

  4. Willem Says:

    Hi Frank, I like working from the debugger like that as well.
    I’ll have a look at the stylesheet (had this problem before, but apparently not fixed well), thanks for pointing it out.

  5. Willem Says:

    Hi Frank, I’ve tried to modify the stylesheet, but can’t quite figure out where the color is coming from now (there were coloured sections for post author and odd items, but removing them does not seem to help :( . I’ll look into it again later…

  6. Willem Says:

    Ok, after giving up I found the solution :) all comments should now be white text on a black background.