Daniel Hoelbling-Inzko talks about programming

How to loose any credibility

Posted by Daniel Hölbling on March 2, 2009

I just listened to Stackoverflow.com Podcast #39 and am completely shocked.

I really like the podcast, I really like Jeff and Joel talk casually about stuff, but when Joel today talked about the SOLID principles (again), I almost screamed.

There were discussions throughout the community when Jeff and Joel said before on podcast #38:

Last week I was listening to a podcast on Hanselminutes, with Robert Martin talking about the SOLID principles. (That's a real easy-to-Google term!) It's object-oriented design, and they're calling it agile design, which it really, really isn't. It's principles for how to design your classes, and how they should work. And, when I was listening to them, they all sounded to me like extremely bureaucratic programming that came from the mind of somebody that has not written a lot of code, frankly.

(quoted from the transcript wiki)

Especially the last line coming from a business guy like Joel to a programmer like Robert C. Martin (the topmost book in my drawer here at work bears his name!) just seemed incredibly silly and plain ignorant.
But, I didn’t blog about it since everyone else did (even Uncle Bob)

I also thought that Rob Conery had a very good post (although too amicable in tone towards Jeff&Joel) about the whole thing and I really couldn’t add anything to it besides my personal feeling that Joel & Jeff were way off track and judged about stuff they don’t have any authority to judge over. Not knowing stuff doesn’t enable you to criticize it.

So, now this time Joel Spolsky ruined any credibility he ever had in the field of writing software when he came up with an example of a method that should not be tested because it’s too hard to write a test for it.

The whole is an example from Copilot, a VNC thingy FogCreek is selling:

I need to write a function that's basically a little button on a toolbar that is going to reduce the JPEG compression.
[snip] So imagine how much code you'll need to write to change a parameter on your JPEG compression library from a 37 to a 10 lets say. Right? And that's all it's gonna do, so this is 5, 10, 20 lines of code to implement this feature, let's say.
But to implement the test, once you have to somehow create a JPEG that is the same as this other JPEG that you have, but compressed at a different level.
And there is no way to actually construct this test in advance, other than actually running it, or if you did, it would be extremely hard. It would take lot of work to write a test that connects to another machine...

He then goes off to talk about having the test run over two different machines (one probably emulated for the test), talking about different versions of the JPEG compression library etc etc etc.

I couldn’t think of a more stupid thing to do. Nothing, never, ever.
Here is the whole test it would need to test the feature (the button that changes the compression rate)

public void Test()
    Assert.Equal(37, jpgCompressionLib.CompressionRate);

Anything more than that, is an integration test and I’m no longer testing the feature, but the JPG Compression library and it’s ability to adapt to the new compression rate.
Anything besides verifying that the compression rate gets successfully set on the library runs out of scope of a unit test, and is no unit test.

And that’s basically it. This one innocent example meant to prove his point just dug the whole deeper. So far as for me it has become clear that Joel Spolsky has no credibility whatsoever left over in the field of software development.

Oh, and by the way. You really should listen to that podcast, it gets even better when Joel continues to make an ass of himself when he starts to bash on PHP as being a poorly designed ripoff of VBscript, that language features in .NET 3.5 have advanced programming far more than these object oriented design principles, etc.

Oh and by the way: I’m always open to discussion so feel free to leave a comment if you think I am wrong here.

Filed under programmierung, internet
comments powered by Disqus

My Photography business


dynamic css for .NET