Convincing your CEO to invest in large architectural “projects” (ie. refactorings, frameworks, technologies) is no easy task. CEOs usually don’t understand technology that well, and software architects usually don’t understand business that well.
Here’s a conversation between a CEO and software architect about why they should refactor their code base to use MVC.
Architect: MVC is a standard design pattern where your model is separated from your controller and view. The controller takes in an incoming request, processes some business logic, and creates a data model for the target view. Then, usually, a view dispatcher will locate the appropriate handler and dispatch the request to the appropriate view. The view them pulls from the model to render its content.
We really need a framework to help us do this.
CEO: Hmmmm…. MCV … sounds interesting.
Architect: It’s MVC.
CEO: That’s what I said… MVC. So, this “MVC” will make our product more user-friendly?
Architect: No.
CEO: Hmmm… but it will make it run faster, right?
Architect: Not really. In fact, it may run slightly slower.
CEO: Really?? Will use less ROM?
Architect. RAM. And no, it will probably use slightly more RAM, too.
CEO: So, you’re asking me to invest a bunch of money in some architecture that won’t improve the feature-set of the product, runs slower, and uses more memory?
Architect: Well, I wouldn’t put it that way…
CEO: Our VC firm isn’t going to like this. What’s wrong with the way we’re doing it now??
And therein lies the million-dollar question: What’s wrong with the way we’re doing it now? Some synonymous retorts might be: “Tons of huge software companies have crappy architecture” or “Tons of software companies with great architecture go out of business”. These are all completely justifiable responses from your CEO. Most of the time, programmers view the CEO as someone who “just doesn’t get it” or “only cares about money”. Because CEOs don’t understand the inner workings of the technology, they are typecast as not being as smart as developers. The truth is that most CEOs are much much smarter… Did you ever wonder why they make so much more money than you????
I’ll let you in on a little secret. It’s not that a CEO just cares about money. Actually, The CEO cares about whatever the shareholders care about; The shareholders are the ones that hired the CEO, after all. And they are the ones that have the power to fire the CEO as well. The CEO doesn’t answer to Slashdot, or to the W3C, or to Sun, or Microsoft, or any of those opinionated bloggers that despise smelly code. He cares about what the shareholders care about - which is almost ALWAYS money. And it’s not just money. It’s money TODAY!
So, any argument to the CEO that involves spending money should include a justification of how that money will turn into more money, and SOON.
Architect: What’s wrong with the way we’re doing it now? That’s a great question. Right now every screen you visit in our application is it’s own unique “file”. The file contains all the programming code to handle the information displayed there. Right now, we have to put some code at the top of every page to check whether the current user is logged in. It looks like this (make sure to write in VB, as VB is mind poison and will disorient your CEO):
If CurrentUser.isNotLoggedIn Then
Response.Redirect “/login_page.html”
End If
Recently our product development team asked us to implement a more robust login checking mechanism that would allow us to check a login across several machines. Unfortunately, the code we wrote above can’t do this. So, we have to go replace everywhere that has the “old” code and put in the fancy “new” code. The only problem is that the “old” code exists in 3,543 different places.
CEO: Wow, that sounds like a lot of work!
Architect: Yes, if we had MVC implemented we could make the change in approximately 1/2 hour instead of one month because MVC dictates that the login checks are all contained in place or are easily added as interceptors.
CEO: How long will it take to write up an MVC?
Architect: Probably about two months.
CEO: Hmmm… Well, we can make this one change in one month, or take twice the effort to do MVC. I think we should just make the one change. It will save 50% labor costs.
Architect: Yes, but you can only afford to make one other major change like this to break even. And with each change after that, you will be losing money and time. Also, developers hate working with unorganized code so it hurts morale. And it introduces more bugs and creates inconsistency in people’s approaches to doing things.
CEO: Wow, that makes a lot of sense.
See how I just convinced the CEO that we should implement MVC? Now, here are a couple of pitfalls I would suggest you avoid:
1. Don’t halt development for a “long time”.
How you define a long time is different for each organization. Be sensitive to this - and figure out a way to develop in parallel, even if it means more overall work. Most products, especially startup products, can’t afford to have innovation halted in favor of architecture refactoring. Sometimes it’s okay to be inefficient.
2. Don’t do too much at once.
Doing too much at once will cause developers to trip over each other, will create more bugs, and will increase the risk of the project. Longer projects mean more investment, which will make it harder to justify ROI on the project.
3. Don’t make things too perfect
There is a law of diminishing returns with refactoring projects. In an effort to “get it right this time”, avoid the urge to get it perfectly right. You can easily double the cost and size of the project while only getting 10-20% more return on your work. Think of it like buying a CPU. There’s always a big jump in price to get the cutting edge fast processor. Only idiots and freaks buy those processors. Always buy the one right below the jump.
4. Provide a short-term ROI
Again, “short-term” is up to each business. If you are a startup, don’t try to justify an ROI that’s going to happen in 10 years. Your CEO most likely cares about next month a lot more than next decade. Find and prioritize projects to give you the most short-term bang for the buck.
5. Never say this:
“In a short 3 years, we can create a framework that will not only be perfect, but it will create all new versions of the software automatically without any work. In 10 years we should see a 4000% increase in profits because of it”
You’ll probably get fired.