a blog

How about unit-testing “Hello World!”

GILES BOWKETT IS GETTING SERIOUSLY PISSED about the FizzBuzz kerfuffle that has rocked the blogosphere as of late. I can see why: a simple test that’s supposed to weed out people totally unqualified for a programming job has become an idolatrous ideĆ©-fix with coders around the world hacking implementations in all programming languages known to man. What a waste of time, except programmers are prone to getting lured into various time-wasters (well, at least I used so).

But I’m not re-blogging his piece to argue about FizzBuzz. He received a Java implementation thereof and noticed how bureaucratic and inflexible it was, especially given the simplicity of the task. He writes:

You need to be flexible and adaptable in business. This Java solution packs layers of beauraucracy onto what might be the simplest programming problem in the world. Layers of beauraucracy have the functional result of impeding change — consider how my solution, you can change anything, whereas the Java one supports some changes and not others, and the developer’s assumptions about what changes may or may not be necessary shape the eventual range of what changes are possible.

But the sociological result of layers of beauraucracy is the real danger here. Sociology is much more important to software development than people generally realize. The sociological effect of Java, in this case, is encouraging conformity and limiting imagination. [...]

Anybody who’s ever seen a software project fail or even falter knows that if you cover every reasonable variation, you’re going to build a whole lot of options that your client or users will never ever use or even see, wasting time and money in the process, while at the same time building something which can bend at every join except the one they need to flex. You shouldn’t cover reasonable variations. You shouldn’t cover any variations. You should code the quickest, simplest solution you possibly can, even if it looks stupid as fuck, and then if your client or your users need some change, you should choose the way to do it which requires the absolute minimum of work.

Amen to that, brother.

Technorati Tags: , ,

comments

Comments are closed.

Additional comments powered by BackType

  • subscribe
  • One man's microISV

    Playground - an on-demand requirements management tool helping you get the right things done.
  • Lifestream

    • ... problem is they are already there about 23 days ago
    • So the Taliban stoned some adulterers recently. I wish US/NATO would bomb them back to the Stone Age but the problems about 23 days ago
    • Not sure that Wave is gone altogether. I can imagine it creeping into Gmail eventually. But why didn't they kill Buzz instead? about 33 days ago
    • Rooting for Uruguay. Still bad memories of CZ vs NL a couple years back. Plus I really like URU's game. #worldcup about 64 days ago
    • @ktorn what kind of app are you going to make for your Samsung? about 65 days ago
    • Firefox 4 nighly looks pretty good to me. But I still have to restart it after installing add-ons? Hope they'll fix that one day soon. about 70 days ago
    • I love that I can put MY photo on friggin Google HOMEPAGE! about 90 days ago
    • Or more precisely, it does seem a bit smarter AFTER you've visited a given URL that corresponds with the query about 92 days ago
    • Safari 5 doesn't seem to have a "smart" location bar. Enter "Google Reader" and it tries to navigate to http://google%20reader/. #fail about 93 days ago