Inside Architecture

Notes on Enterprise Architecture, Business Alignment, Interesting Trends, and anything else that interests me this week...

Mort and the Economics of Unmaintainable Code

Mort and the Economics of Unmaintainable Code

Rate This
  • Comments 31

I've been called a lot of things in the past few days since I had a public disagreement with many folks over the definition of Mort.  On the surface, it looks like I'm a pretty "out of touch" guy when it comes to the 'common vernacular.' Granted, but looks can be deceiving.  There's more here.  Please bear with me.

First off, I want to publically apologize to Sam Gentile.  I meant no offense when I asked if he wanted MS to develop BDUF tools.  It was an obviously absurd question, (OK, obvious to me, not obvious to Sam).  I sometimes ask obviously absurd questions when I want to point out that the "logical conclusion" of a line of thinking will take someone where they don't intend to go.  That didn't work on the blog.  My bad. 

Add to that another mistake: My reading of Sam's message to me was probably incorrect.  In a response I made to a post on Microsoft and Ruby, Sam said:

I don't think you are getting that point. MSFT is making tools for Morts (the priority) at the expense of every other user (especially Enterprise Developers and Architects). They have nothing for TDD. And I would further contend that making these tools "dumbed down" has significantly contributed to why Morts are Morts in the first place and why they are kept there. Think VB6 and the disatrous code that was unleashed everywhere. If Microsoft took some responsibilty and created tools that advocate good software design principles and supported them then things would be different. You and Peter (which is a friend of mine) are covering the corporate butt. It's a cop out.

Does it look like Sam is saying "Mort is dumb" or "Mort is bad?"  I thought so at the time.  Perhaps that was not right.  I carried my misreading a bit further.  I read Sam's message to mean, "people who think like Mort thinks are errant."  In hindsight, I believe that Sam meant to say "people who work like Mort works are errant."  The difference is subtle but the result is profound.  Implication: Mort is not a bad person or a stupid person, but the code that Mort produces is not maintainable, and that is bad for all of us.  (I hope I got that right this time).  Sam cares about maintainable code

To rephrase, the problem is not Mort.  The problem is the unmaintainable code he produces.

So my apologies to Sam. 

But was I insane in my conclusions as I've been accused of?  Did I redefine Reality? No.

First, let me put up a quadrant. 

Agile Quadrant

I got the axis values directly from the agile manifesto, so it shouldn't be a surprise to anyone in the agile community. 

Take a look for a minute and see if there's anything you disagree with.  One thing that may be a bit odd is the entry called "agile tool users without ceremony."  This is for the folks who use agile tools like NUnit and CruiseControl to do development, but don't follow any of the other elements of agile development (like rapid cycles, time-box development, FDD, XP, Scrum, etc).  I don't know how prevalent these folks are, but I've certainly met a few.

Regardless, look at the values expressed in the Agile Manifesto.  Someone who cares more about "meeting the needs of a user" than they do "following a process" would move up the Y axis.  Someone who cares more about "working software" than they do "comprehensive documentation" would move along the X axis.

OK... reader... where is Mort?

Think about it.

Mort doesn't follow lots of process.  He writes code for one-off applications.  Why?  Because that is why he was hired, and that is what he is paid to do.  He does exactly what his company pays him to do.  Does he write a lot of documentation?  No.  So given those two variables, which quadrant does he fall into?

The upper right.  The one marked "agile."

If you wonder why a lot of development managers are unsure of the agile community, it is because this comparison is not lost on them.  Any person who doesn't care for process and who doesn't want to write a lot of documentation can fit in that upper quadrant.  Agile folks are there.

So is Mort.

I can hear the chorus of criticism: "That doesn't make Mort agile!"  Hugo is Agile.  Mort is not!

I'm not done.

Mort is certainly a problem, because in our world, unmaintainable software is a pain to work with.  Some folks have decided not to hate Mort but to educate him.  (which is good).  The subtle goal here: move Mort's skillset and mindset: help him to value maintainable code. 

If we do this, and we help Mort grow, will he keep his current job?  Probably not.  He was hired into his current job because he was a Mort.  He was hired because his company values quick fix apps.  Once our intrepid student no longer values unmaintainable code, he will no longer fit in his current positon.  He will find another job.  So what will the company do with the open position?  They will hire someone else and TRAIN THEM TO BECOME ANOTHER MORT.

Remember, we don't hate Mort.  We have a hard time with his code.  We want to eradicate his code.  But the code is still being developed... by a new Mort.

There are an infinite supply of new Morts.  Therefore, the solution of "educate Mort" doesn't work to solve the problem of unmaintainable code.  The solution doesn't address the underlying reasons why Mort exists or why his code is bad.  You cannot fight economics with education.  You have to fight economics with economics. 

Let's look at the economics of unmaintainable code, and think about Mort a little more.

Code is unmaintainable because it's complexity exceeds the ability of a developer to maintain it.  Would you agree that is a good definition of 'unmaintainable code?' 

Rather than look at "making code maintainable," what if we look at making code free.  Why do we need to maintain code?  Because code is expensive to write.  Therefore, it is currently cheaper to fix it than rewrite it.  On the other hand, what if code were cheap, or free?  What if it were cheaper to write it than maintain it?  Then we would never maintain it.  We'd write it from scratch every time. 

Sure, we can choose to write maintainable code.  We can use practices like patterns, object oriented development, and careful design principles.  On the other hand, we can give Mort an environment where he can't hurt himself... where his code is always small because only small amounts of code are needed to get the job done. 

This is useful thinking here.  If you cannot make sure that Mort will write maintainable code, make him write less code.    Then when it comes time for you (not Mort) to maintain it (he can't), you don't.  You write it again.

And that is fighting Mort with economics.  Soon, Mort's skill set doesn't matter.  He is writing small amounts of unmaintainable code, and we really won't care.  Someone 'smart' has written the 'hard' stuff for Mort, and made it available as cross cutting concerns and framework code that he doesn't have to spend any time worrying about.  Mort's code is completely discardable.  It's essentially free.

Hugo cares about quality code.  Mort does not.  In the fantasy world of free code, what value does Hugo bring, and where does Mort fit?  Does Mort put process first or people first?  He puts people first, of course.  He writes the code that a customer wants and gets it to the customer right away.  The customer changes the requirements and Mort responds.  If it sounds like a quick iteration, that is because it is.  This process is fundamentally agile

Yep. I said it.  In situations where maintainability doesn't matter, Mort is agile.  His values are agile.  He is paid to be agile.  He delivers value quickly, with large amounts of interaction with the customer, not a lot of process, and not a lot of documentation.  According to the Agile Manifesto, in a specific situation, Mort is agile.  He is also dangerous. 

So we constrain him.  As long as Mort can't hurt himself and others, we are protected from him. 

Of course, we can give Mort smarter tools.  But that goes back to the argument that Mort is the problem.  Mort is not the problem.  His employer is.  We train Mort.  He becomes a quality programmer.  He leaves. The company hires another Mort.

So what about those Morts that we cannot train?  Every time we try to shove great tools at "untrainable Mort", we don't get "smarter Mort."  The tools get used by other people, but Mort ignores them.  We get faster and better code written by the people who care about faster and better code.  Mort doesn't care.  He is not paid to care.  He is paid to write code quickly, solve a quick problem, and go on.  His code is not maintainable, and THAT IS OK, because he can write small amounts of code (or no code) and still deliver value.

So how do we pull this off?  How do we allow Mort to write small amounts of code so that we don't care?

We've been trying to solve this problem for a decade or so.  We tried creating an easy drag-and-drop environment, but it didn't protect us from Mort.  We tried creating controls that do all the hard stuff, but it didn't protect us from Mort. 

Now, SOA and the Web 2.0 space has opened up a whole new world for Mort to play in.  Generation Next is here, and finally we may be a bit closer to an answer.

Possible Answer: We can have Mort consume a service.  He can't change it.  He can't screw it up.  But he can still deliver value, because often 60% of the business value is in supporting individual steps in a business process.  Those steps are carefully controlled by the business, but honestly, are not that hard to put together.  It's a matter of "step one comes first, step two comes next."  As long as the details of the interaction are hard to screw up, we are protected from Mort. 

Here's the cool thing: Microsoft didn't invent this iteration.  This little bit of "Mort defense" came from the integration space (think ESB) combined with great thinking from the web community.  This approach is not something we thought of, but it works to the same ends.  This new way is based on SOA principles and REST protocols (what some are calling WOA or Web Oriented Architecture). 

Web 2.0 and Mashups are the new agility.  Write little or no code... deliver value right away.

And in this space, Mort is agile.  Heck, we even like him.

And in case you are wondering why I don't hate Mort... this is the space I live in.

  • And who is going to write that service that Mort consumes?  In many organizations, what Mort cannot find or access quickly, Mort (or his similarly Mort-ish colleague) creates and/or re-creates.  How exactly do you see SOA (+/- tools) changing this behavioural pattern?

  • The debate goes on ... but Mort still isn't Agile! I appreciate Nick's clarifications, they have helped

  • It is very hard for people to imagine that some software is, in fact, disposable.  Maintainability comes at a price, and there are times where the correct business decision is to value expediency over maintainability.

    I once wrote a piece of software that was used in production... exactly... once.  The purpose of it was to generate a set of word documents translated from html in order to provide a one-time snapshot of the contracts that were being aquired from an aquiring firm.  The systems we were pulling the data from were going away in 3 weeks, as the aquiring company was based on an entirely different app stack than the old one, and had no desire to work with it at all, regardless of it's code quality.

    Had I spent extra time writing a full set of unit tests, automated user acceptance tests, and so on, I would have been wasting the time, and therefore money, of the client that needed a one off solution.

    This kind of scenario happens more often than most capital A agilists tend to want to admit.  Not all code lives forever.  Some code doesn't live until the end of the month.  And that's ok.

  • ...Microsoft might stop trying to convince Mort's boss that Microsoft's tool actually deliver the indescribable value not described at the demo of Microsoft's tools to Mort's boss.

    We all have a role to play.  We're out in the field trying to undo the damage comes when marketing imperatives trump meaningful agility, and Microsoft has a giant role to play in contributing the the circumstances that are a significant cause of the existence and persistence of Mort.

    The company could still be successful without the assumption-driven development-styled tools, but I think that it has since fallen prey to the very fear that it mongered in effort to achieve great swaths of its dominance.

    There's a whole heck of a lot more to being on an effective, cross-functional agile team than the treatment you've laid out here.

    I would agree that based on your perspective of agile development that Mort can be thought of as agile, but it's a bit of a shallow treatment of agile development.

  • Imprisoning Mort

  • My response here:

    http://www.blogcoward.com/archive/2007/06/19/33.aspx

  • Nick Malik wrote a post entitled "Mort and the Economics of Unmaintainable Code" where he espoused the

  • The graph needs a 3rd (or more) axis.  More might be here with intentions, but his education will lead him to develop some software that will rot even before it's finished (think 30000+ lines of code for something non-trivial).  The uneducated practices will focus on working software, but the lack of discipline will cause development to grind to a halt because of complexity and lack of quality that the product might not even be delivered.

    This works great for small things, but Mort also develops larger things.

    The dream of making code free or close to it is tempting, but can it ever happen?  If so, then why give us professionals the same tools meant for Morts?  Shouldn't it be a different set of tools?  

    In the end, I do blame management for all things wrong in their own software shops.  They don't know how to tell the difference in software professionals, and that is _their_ fault.

    Interesting post.

  • @Nicole,

    Excellent question.  The real value of creating a services layer is to hide the hard stuff in the services and then allow the composition to happen at the Mashup / SO Composition level, keeping Mort out of the services altogether.

    So to answer your question: Mort does not write the services.

    Of course, that doesn't mean that services will only be written by someone who cares about quality... at least not yet.    

    The fiction of my scenario meets reality when we start discussing the skill level of the professional developers charged with writing the services.

    I have hope though.  I'm proposing a framework for use within the behemoth that is Microsoft IT for creating a framework of services that we can expose to open source.  That framework would allow services to not only be created internally, but created externally as well.  Our company could literally purchase the 'create order' service from one company and the 'create invoice' service from another.

    So the question of who creates the service becomes even more interesting... if we start competing on the quality of the services, then Mort's service loses out.  

    Once again, economics wins.

  • Nick, I hear what you are saying about providing services written by Hugo, Elvis or Einstein ... and that you are proposing that Microsoft start moving that way.

    But do you really see Microsoft doing that? They have a fairly fundamentally anti-service approach to a large proportion of their codebase - an obvious example would be the Enterprise Application Blocks.

  • @Jeffrey,

    30,000 lines of code is not free.  If we make someone write that much code to solve a business problem, then the world I'm hoping to achieve has not yet come to pass.  Mashups shouldn't require 30,000 lines of code and neither should compositions.  I'm thinking 500 lines of code.

    As for the tools: the parts of Visual Studio aimed at making Mort successful are not the parts of Visual Studio that you will use.  We've tried selling two tools, one for Mort and one for you.  

    We've discovered something.  Mort's manager doesn't want to pay for a license for Mort's tool, and another license for yours.  He wants one liscense, and then he can hire the person he needs to solve the problem.  More flexibility for him.

    So we need to put the Mort features in the same tool.  You are free to ignore them.  The environment works as well as any other IDE for professionals.  Mort's tools don't get in the way.

    Honestly, folks who say that Mort's tools get in the way are folks who are using Mort's tools but trying to do the job of a professional developer.  Stop it.  Do the job of a professional developer without using Mort's tools.  Reset expectations.  You are not SUPPOSED to be as productive as Mort because you are solving unconstrained problems.  

    We go where the market goes.  We'd be foolish not to.

  • @Casey,

    The application blocks are designed to be infrastructure within the stack, and there is a newer version that is cleaner and better integrated.  I think the AB has come a long way.  That said, I'm much more excited about the service factory than I am about the application blocks.  

    And, yes, services are BIG inside Microsoft.  Did you know that Microsoft Office Sharepoint Server (MOSS) is service enabled out of the box?  What about WCF and the fact that most aspects of the contract are declared in configuration, not code?  Very powerful.  Very service oriented.  Cutting edge.

    We've been snapping services onto every place where it makes sense to allow remote user interfaces (with a few notable hold-outs).  

    In fact, Microsoft just released an ESB toolkit on Codeplex last month (CTP1).  Take a look at http://www.codeplex.com/esb for details.  It is Biztalk based (so don't ask me how we can call it an ESB) but it is still a fairly solid example of movement in the right direction.

  • @Nick, you say: "Honestly, folks who say that Mort's tools get in the way are folks who are using Mort's tools but trying to do the job of a professional developer.  Stop it.  Do the job of a professional developer without using Mort's tools.".

    That's an interesting observation, but then I'd ask one thing: Since a lot of VS these days seems to be then squarely aimed at Morts... then what development tool does MS have for the non-morts? :)

  • You are on the right path Nick; frameworks and services are definitely a starter in getting the code that Morts write to have more predictability and a better chance to be maintainable in the long run, and to have less of it!

    In a large enterprise though, I have seen that you need to provide a "platform" not just frameworks and un-managed, un-architected services to have long term success. As one commentor stated "your thesis works for small things" but starts to break down on larger efforts, more mission critical efforts.

    There are two key components I believe that turn frameworks into platforms.

    Platform Component - These are your guiding principles of your architecture style(e.g. standardization, abstraction, virtualization, loose coupling etc..), the processes (think governance over what gets built) and organizational makeup (people working in well defined roles, accountable for well defined things).

    Enablement Component - These are your best practices, reference implementations and most important of all the mentoring of Mort by your architects to enable him to be successful delivering solutions on the platform. The reason why so many Morts cringe, and many times rightly so, about architecture or governance is that we haven't provided the enablement component for them to be successful!

    Where I have worked, the Platform Component is usually an afterthought or nonexistent.

    The Enablement Component is sometimes there, but it varys from group to group. Most often Mort is on his own to figure out how to best solve the problem at hand and that is when you get 30000 lines of code.

  • @Steve

    You are a wise man, Steve.  Send me an e-mail using this forum (if you get this message).  I'd love to share ideas with you and get feedback.  I working along the lines of what you describe, to a point, but my system is constrained in a different way.

    --- Nick

Page 1 of 3 (31 items) 123