Thursday 21 August 2008

What have the agilists ever done for us?

Cue a gratuitous link to Monty Python material, almost guaranteed to distract a geek:

Right, what I actually wanted to do was sing the praises of — or at least mention — the greatest benefit that agile development has brought me: a reduced tolerance of duplication. Not only that, but an improved ability to identify it, in all its forms.

Hmmmm... what do I mean by "in all its forms"? Obviously, there's the straight copy-and-pasted code duplication. And then there's code that's been copied and then very slightly changed, or had its variables renamed. But some of the trickiest problems I've tackled have come from different bits of code that have shared assumptions and knowledge that aren't immediately obvious. Being able to spot that early and isolate it and/or make it explicit can be immensely valuable.

I sometimes wonder whether I've become too fixated on duplication, to be honest. I find myself getting unnecessarily aggravated at work when I perceive others to not care as much about it as I do. Am I just being pompous in thinking that my colleagues don't care about it enough? Yes, almost certainly. Besides, we're judged by our actions more than our words and the evidence suggests I've done very little to tackle the issue in my day to day work. Well, very little beyond avoiding duplication in new code. I've barely scratched the surface of our legacy issues.

Getting back to the topic of this post — that of agile's influence — what first drew my attention to duplication as Evil #1? It's hard to say. I don't think it was test-driven development's emphasis on refactoring; I was aware of refactoring before that. However, I do suspect it played a part. Really, I think TDD just seeded a crystal. All the elements were already there, swilling around in my noggin, but TDD and refactoring brought them together for some kind of mini-epiphany. Reading Test-Driven Development By Example probably helped too. As much as I'd like to limit my praise of Kent Beck, that was a pretty good book.

What about your experiences? What's the biggest benefit agile brought to your development life? Assuming it brought any, that is... ;-)

Saturday 9 August 2008

Hardware prognosis

It's not looking good, folks. Despite repeated attempts, my hardware CPR seems to be failing. Dammit Jim, I'm a programmer, not an IT technician!

However! I don't want to let this blog die just yet, even if my computer has. I'm going to see if I can rattle off some more navel-gazing, agile development posts. And maybe take the time to look into AI routines a bit more. Heck, if programming's not an option, I might as well invest in a spot more BDUF as well.

Finally, if anyone's got any tips for a decent desktop PC that'll be good for development, I'd appreciate them. Doesn't have to be a super games machine; just something cheap and adequate (£300-400). I'm currently thinking Dell, but that's just me being attracted by out-of-the-box usability. Anyway, all suggestions welcome.

Tuesday 5 August 2008

More Beaver logging

At the end of my last development-related post, I said I should probably run more tests to confirm the apparent first-player advantage in Beaver. Well, I've done that now.

Without coding any of the minimax stuff, I've run each existing strategy against each other, going both first and second. While the cleverer strategy always has a higher win percentage, regardless of whether it plays first, tests in which both players use the same strategy continue to show a first player bias:

StrategyP1 winP2 winDraw
Adequate46.1%38.2%15.7%
Dumb47.4%38.0%14.6%
Dumber44.1%39.9%16.0%
Dumbest59.5%27.9%12.6%

So, the next step would be to create a few more strategies to test it with. :)

At least, that would be the next step if my computer hadn't just died, taking the source code with it (and god knows what else). Thankfully, I've still got a fairly recent copy of the EXE and the game logic assembly on a USB flash drive, so if all else fails, I'll be able to use Lutz Roeder's .NET Reflector to recover most of the source code. Albeit source with poorly named variables. Hey ho. Guess it's time to get a new PC...

Saturday 2 August 2008

Steve McConnell on Agile

I originally wrote loads of introductory waffle for this link, but to hell with that. Agile Software: Business Impact and Business Benefits. Enjoy. :)