Dependency Injection with StructureMap Database Myths: Stored Procedures vs. Ad Hoc Queries
Jul 30

This is in reply to Ayendes post.

For those who haven’t followed the discussion, it all began with the release of NHibernate 2.1.

Shortly thereafter, Patrick Smacchia made this post where he analyzed what had changed in NHibernates code base and measured its quality with NCover. He came to the conclusion that it must be a daily pain to maintain the code.

In reply to that, Ayende said that it is structured, although not by name spaces and the like (Patrick’s analyses made that assumption) but different. To underline that NHibernate is indeed maintainable, he pointed out that several new committers joined last year, that there were many new features while at the same time fewer issues.

Frans Bouma made a comment where he said that even a mess looks like something acceptable to those who work with it. This lead to Ayendes post to which I respond.

I have to say, I agree with Ayende. Rating how maintainable a code base is can only be done by those who actually maintain it.

If you have to deal with an application written in a language you don’t know, would you say it’s unmaintainable just because you’re not familiar with the language? Code bases are to some extent like that as many, especially larger ones, have their very own conventions and those conventions aren’t limited to naming conventions and the like but can span the structural or architectural level too.

The VB6 application I talked about in my refactoring series was very easy to learn as the only used pattern was copy and paste. You’d simply go in, copy what you need and paste it into its new place, everyone could do it, everyone did it. However, the result was an unmaintainable mess.

Therefore I’d say that although learning a code base is required to effectively maintain it, learning and maintaining it are two different metrics that should be looked at independently. The learning cost is a one time cost, fixing a bug or adding a feature isn’t.

Yet another story is ongoing learning, this has directly to do with maintainability as no one can remember every line of an entire code base that has a sufficient size.

If a code base is consistent with its conventions, no matter how strange they may first seem to outsiders, there shouldn’t be a problem as this ongoing learning cost will stay at a low level.

Please note that I’m not saying “that’s a convention” excuses everything. There has to be a structure and concepts have to be followed but this structure or these concepts don’t necessarily have to jump the outsider right in the eye as it is the case in the classical three tier architecture for example.

Bookmark and Share

One Response to “Maintainable but not Learnable?”

  1. Maintainable but not Learnable? | Coding Efficiency…

    Thank you for submitting this cool story – Trackback from DotNetShoutout…

Leave a Reply

preload preload preload