Focus – what it really means and why it’s important

When I started my first company in the late 1990s, many people advised me on the importance of focus.

“Focus”, I’d repeat and nod sagely, not really knowing what they meant.

“Focus” seemed like an inherently Good Thing™ on the face of it – like happiness and democracy – but a pretty vague concept.

Since then, personal experience has shown me the critical importance of understanding what focus means when building a company.

Focus is absolutely essential when building a startup but it’s also important for companies at any stage so I hope this is useful and relevant to all.

Focus – a definition

So, how do we define “focus” in the context of building a company? I would define it like this:

Focus is maximizing the time spent on the essential complexity of the problem your company is trying to solve and minimizing the time spent on incidental complexity.

Every company and every product is trying to create some value for its customers and users. Without that, the company and product by definition has no value. Typically, creating that value can be thought of in terms of solving some problem for your customer.

The more time you can spend on understanding the value you are creating for your customer –  i.e. understanding the problem you are solving for them and solving it – the more you are increasing the value of your company.

Working out what the value is you are creating –  the problem you are solving for your customer and how to solve it in the best possible way – is the essential complexity of your company.

In contrast, time spent on incidental complexity does not increase the value of your company and product.  It simply takes away time and energy from working on the essential complexity.

In summary, you don’t build value by solving problems that others have already solved – you create value by solving problems not yet solved and, to a lesser extent, by solving problems in significantly better ways.

Incidental Complexities

So, what are incidental complexities?

Here are some examples of the most common ones I’ve seen (in no particular order).  I bet many readers will have seen all or most of these:

  • infighting between colleagues
  • “busy work” that could be automated easily
  • reinventing the wheel
  • failure to make decisions / trying to keep too many options open
  • early stages of recruitment – finding candidates, reviewing resumes
  • meetings with ill-defined agendas
  • waiting because of colleagues’ poor time-management
  • attending conferences without pre-scheduled meetings and clear objectives
  • over-analysis of vendor/technology selection
  • doing your own IT support
  • obsessing over your competition
  • pitching investors
  • trying to make money from things that are not part of the problem you’re solving for your Customer
  • frequently switching between multiple tasks
  • rewriting things that are good enough (see my post on Why You Should (Almost) Never Rewrite here)

Let’s look at some of these examples in more detail and try to  identify some general sources of incidental complexity.

Decisions

“We would rather suffer the visible costs of a few bad decisions than incur the many invisible costs that come from decisions made too slowly – or not at all – because of a stifling bureaucracy.” – Warren Buffett

“Commit to making decisions. Don’t wait for the perfect solution. Decide and move forward.” – 37signals

“A good decision is a made decision.” – Clayton Christensen

Many people have written about the art and importance of decision making.  I will not attempt to cover this topic in depth.

My view is simply that you don’t learn anything from a decision you don’t make.  Whereas, you learn from all decisions, especially bad ones.  Fail fast, move on.

Startups, in particular, are all about making high-risk, low-data decisions.  If you don’t have the stomach for those, you shouldn’t be running a startup.  Deferring hard decisions just creates ambiguity and saps time, morale and energy.

Choice is Bad

When it comes to moving quickly and focusing as much time and energy as possible on the essential complexity of your business, choices are a Bad Thing™.

This seems counterintuitive to many people, especially in the West where our culture is built on the importance of individualism and choice, and denial of such freedom is tantamount to treason. However, choice in areas outside of your essential complexity just slows you down.

In software development, one of the reasons that Ruby-on-Rails is so popular, and one of the reasons why we currently use it, is that it is built on the principle of “Convention over Configuration“.  This principle is about reducing the number of decisions a developer has to make – gaining simplicity without necessarily losing flexibility.

Think about every aspect of your business in these same terms.  Everyone likes to think that their business is special and unique but the reality is that, outside of the essential complexity of your business, the other challenges you face are common to 90-100% of businesses of a similar size and stage of growth. They are solved problems and therefore textbook incidental complexity.

Analyzing choices that don’t really have impact on the value you’re building isn’t time well spent.  In a typical Silicon Valley startup, these are decisions like which accounting system to use, which CRM system to use, which web development framework to use.

Of course, I’m not advocating making completely blind choices with no thought whatsoever. However, what I’ve seen is that people often err on the side of overanalysis. The return on this time diminishes very rapidly.

If it’s not core to your competitiveness or differentiation, why spend another hour or day or week analyzing to make a 5% better decision?

Outsource Everything You Can – Use Specialists and Don’t Reinvent the Wheel

Money spent taking away incidental complexity is money, time and energy saved to focus on essential complexity.

A classic case in point is recruitment – people hate recruiters.  With a few notable exceptions, I hate them too.  But, they are a necessary evil.  At the time of writing, hiring in Silicon Valley is as hard as it ever has been in my memory.

To be clear; recruitment is one of the most important things that you can do as a founder, manager or executive – controlling the quality of the people that you let in is one of the best controls you have over the quality of your company and its output.  Therefore, I would never advocate for outsourcing the process of choosing the best people.

But, that doesn’t mean you have to burn lots of hours of your own time on the front-end of the recruitment process – finding people, contacting them, reviewing resumes, screening candidates, etc is not a good use of your time – outsource it.  That’s what recruiters do. Their fees may seem outrageous but they’re not when you consider the real cost of the time you’d spend doing it yourself – not only the direct cost of your time, but the much bigger opportunity cost of not spending that time addressing your essential complexity.

Another big mistake I’ve seen is startups taking non-core parts of their customers’ business process and incorporating them into their own product – invoicing, online payments, backup, logging and monitoring, reporting, hosting, etc, etc, etc.  These aspects are peripheral to your essential complexity so they should be peripheral to your product.  They are solved problems.

Usually, what superficially seems like a simple problem to solve inevitably turns out to be more complex.  By implementing the functionality in your own product, not only have you lost that time you could be spending on essential complexity but you’ve also taken on the burden of supporting and maintaining a feature that doesn’t return anything for you in value and differentiation.  You’ve basically re-invented the wheel.

Don’t forget that the vendors of these systems understand their overall domain pretty well (it’s their essential complexity) and they are building products that cover 70%-100% of the most common requirements.  At the same time, you likely understand your own problem domain better than almost anyone so, if you happen to have unusual or unique requirements on invoicing, data backup, etc, you’ll know about it. If there is some aspect of these systems that you are differentiating on, that validly falls into your essential complexity.

These days, with SaaS companies proliferating and APIs available for more and more business systems and processes, it’s very simple to incorporate all of these important but non-core aspects into your overall offering with minimal effort.

Today, most companies wouldn’t imagine building their own data centers – most companies just use the Cloud (Amazon EC2 or similar).

Take that to it’s natural conclusion – what other aspects of your business can you out-source?

Beware False Economies

In a startup, money is always tight, and managing your cashflow is critical to success.  However, it’s easy to let this drive you into false economies.

In every business there is “busy work” that is no fun but just has to get done.  In startups, this is a bigger problem because people have to wear many hats so this busy work has to be done by someone who has many other things to do.  Some of those things are likely to be part of your essential complexity.

Every case is unique but always think through the true cost of having internal resources spend their time on busy work that could be easily automated and/or outsourced.  Again, there is a direct cost but a bigger opportunity cost.

Don’t Sweat the “Competition”

Another mistake I have seen is for early stage startups to waste time and energy worrying about their “competition”.

The reality is that, early on, most startups are in an ill-defined space and still in the Customer Discovery phase.  This means your “competition” is hard or impossible to define.  Your true competition will emerge over time, once you’re out of Customer Discovery and better understand your positioning.

In the meantime, just focus on creating value.  You’ll likely beat your “competition” simply by focusing more of your energy on the essential complexity of the problem you’re solving than others.  The faster you understand and solve the problem for your customer, the faster you create value.

Death by Meeting

So many people have written about meetings, that I will only give it a cursory discussion.

In my view, meetings are another necessary evil but are overused.  Here are my guidelines:

  • meetings should be schedule to 30 minutes by default, not 1 hour
  • only invite those people who need to be there.  The productivity of a meeting decreases with the square of the number of people in the meeting.  Those people that need to be in the loop can be updated by one of the people in the meeting afterwards.
  • every meeting has a clear objective – not a detailed agenda, necessarily – a clear objective of what is expected to have got done by the end of the meeting
  • every meeting starts on time

Beware the Cost of Context Switches

Another hidden cost of having insufficient focus, is the cost of continually having to switch between tasks.  This switching cost is often underestimated or ignored.

Paul Graham wrote a great post on the big impact of context switching to “makers” (software engineers, etc) versus managers, who are generally more used to scheduling their time in blocks.

Actually, the cost of context switch is there for  everyone, even the most adept executive with the most fastidiously managed calendar. Research shows that human brains are very poor at multi-tasking and, ironically, those that think they are best at multitasking are actually the worst.

Don’t Underestimate the Importance of Motivation and Energy

If you’re only looking at the time spent, you’re only seeing part of the picture.  You need to understand the importance of motivation, energy and morale on your own output and the output of the company as a whole.

Incidental Complexity not only takes time away from Essential Complexity but it also demotivates and saps energy and goodwill, especially when the people doing the work know they are working on Incidental Complexity.

Essential Complexity – What Should You Be Spending Your Time On?

So, what should you actually be spending your time on?  What is essential complexity?

It’s tough to give a simple, single answer to this question.

Firstly, it depends on the stage of your business.  At this point, I will pause to plug Steve Blank’s book “Four Steps to the Epiphany“.  I dont’ know Steve but if there is just one book you should read on how to build a startup, you should read this one.

Early on in a startup, the essential complexity is working out who your customer is, the problem you are solving for them, the value of that problem, what your product is and how you’re going to solve it.

Once you’ve solved that (and only once you’ve solved that), your essential complexity becomes understanding your customers’ problem in even more detail and making sure you are designing, building and deploying a product that best satisfies those customer needs.

Further down the line, the essential complexity will be to make sure you stay ahead of your competition, increase efficiency, etc.

Of course, you can’t also ignore the #1 rule of any business; don’t run out of money.  So, raising money is also essential complexity for most startups.

It also depends on your individual role in the business but this is easy to overstate.  In a startup, people always have to wear multiple hats.  The right things for you to do are the right things to do, whether  or not they are strictly speaking part of your “job description”.  People who have rigid ideas about job descriptions probably shouldn’t be working in startups.

Some Focused Suggestions

In a smaller company (i.e. a typical startup), the first step is to make sure that everyone – from the CEO down to the intern – knows what the critical success factors of the business are – i.e. what are the things that the business needs to get done in order to be successful.  This list will change over time but needs to be regularly communicated and repeated.  Achieving these critical success factors is the essential complexity for your business.

With that list in mind, every person in the company needs to get into the habit of asking the following question:

Of the things I could be doing, am I currently doing that task which most contributes towards the business achieving its critical success factors?

Of course, people won’t always get the answer right.  Also, very often, and particularly for those people lower in the organization, they may be several degrees of separation away from the overall success factor for the business.

However, don’t underestimate people too much – I think most people will answer this question correctly more often than not.  The trick is to get and keep the list of critical success factors at the front of everyone’s minds and to get people into the habit of asking the question of themselves, and of others.

The next part is about communication.  People need to communicate what they think their priorities are and why.  This helps flush out people’s dependencies on each other.

In a very small organization this can be done verbally.  Once you’re beyond about 10 people, it makes sense to write these down and communicate them – I’d recommend weekly, by email.

As the organization grows, you’ll have to get more formalized.  In a bigger organization I’ve seen large SIPOC exercises run at whole-company off-sites work very effectively.

Whatever the size of the organization, the most important thing is that you and everyone else understand the difference between essential complexity and incidental complexity and what the specific critical success factors are for your business.

Focus, focus, focus.

Agree, disagree?  Please leave a comment (link at top of article).

Advertisements

The Funnel is the Product, The Product is the Funnel

Others have made the important point that the critical word in the phrase “Software as a Service” (SaaS) is “Service” not “Software”.

Taking this a stage further, I believe that the traditional distinction between a company’s “Product” and the stuff that surrounds it needs to be completely eliminated.

In my view, this distinction is a hangover from the bygone days of software companies selling boxed software products.  In contrast, if you’re a SaaS company, you’re truly in the service business, not the software business, so your view of what constitutes your “product” has to evolve.

The Traditional View

The main building blocks of a “software company” have traditionally been:

  • the “Product” – this is the functionality that delivers on the company’s value proposition.  The “Product” is built by the development team and actively worked on.  For online software (i.e. most software these days), the “Product” is generally everything that’s behind the log-in stage.
  • “Marketing Material” – this is generally static content including the homepage and those other pages that are linked to from it.  It describes product features, benefits, case studies, etc.
  • “Sales” – unless your company relies solely on self-signups, these are people responsible for getting customers to pay for your product.  In contrast, the job of development is to create what people get after they’ve paid.  The Product does not directly help with “sales”, except in the obvious sense that it’s the promise made of what you’ll get when you pay and you might be allowed a free demo beforehand.
  • the “Funnel” – in most companies, there is typically the notion of a funnel – i.e. that series of steps that a person has to go through from first contact with your company to becoming a customer, be they on your website or on the phone with a sales rep. There may be people focused on increasing the conversion rate through your funnel (i.e. the % of people that end up being customers after first contact) and these people may even be active planning to reduce friction at each stage of the funnel.  However, the “Funnel” is generally still thought of as “marketing stuff” – not part of the “Product”.

What’s the Problem?

This is how the story of an Internet startup typically plays out:

After an initial launch, the rush is then on to keep evolving the product and keep delivering on a roadmap of features.  The development team thinks its job starts after the user is signed up and signed in and that its role is to give the user more and better stuff for their usage / money.

In contrast, the “marketing material” quickly becomes the poor step-child of the product and becomes stale as it increasingly gets out of sync with the product over time.

This happens for a few reasons:  partly because no one inside your company ever looks at it (out of sight, out of mind), partly because the marketing team is much smaller than the development team so there is little bandwidth for content changes and, often, because changing the static content is hard (it often requires involvement of developers who see it as busy work).

As for the Funnel; it may be actively measured by marketing and sales people. Also, noble efforts may be made to improve conversion each step along the way but the Funnel is still “marketing stuff” in the eyes of the development team and large scale changes to it are hard to make happen since the Funnel is not part of the “Product”.

Typically, the things that are deemed worthy of development attention and time are, in decreasing order:

#1 the platform
#2 the product
#3 the funnel
#4 the marketing material (static content)

Your Potential Customer’s View

Unfortunately, if you are in the shoes of a potential customer, it’s the marketing material you usually see first and which forms your first impression.

So, to the potential customer,  the order above is exactly the reverse order of importance.  It should be:

#1 the marketing material
#2 the funnel
#3 the product
(#4 the platform) – never really seen by the customer, except indirectly

You can lose huge numbers of potential customers on their first touch with your company if your marketing content is weak.  Inside your company, marketing and sales realize that first. Development often doesn’t realize it or does and doesn’t care.

This creates tension and all the required ingredients for a text-book “marketing versus development” internal feud seen in so many software companies.

The Funnel is the Product

The solution is to abandon the notion of “marketing stuff” vs “product”.

In this view, everything that a potential user sees is now your “product” and should be continually improved and finessed, starting from the stuff the potential user touches first – typically your homepage.  Because everything is now the “product”, development now owns it too.

For a lot of people, this is a pretty fundamental change so don’t expect to be able to make it over night.  It’s about seeing your product from an outside-in perspective, rather than an inside-out perspective.

However, this transition has a number of significant benefits:

  • everyone – including the development team – is engaged and feels responsible for driving usage and, if applicable to your business, sign-ups
  • much less, if any, “them versus us” mentality between marketing/sales and development
  • “marketing content” no longer the poor step-child and no longer out of date
  • the funnel is part of the product, usually resulting in a more innovative, more interactive and smoother funnel meaning less friction and, hence, more users

The Product Event Horizon

Making this change requires joined-up thinking.

As soon as someone has a slightest touch with your company, your product needs to act like a tractor-beam and gradually draw that person deeper and deeper in.  The product needs to progressively reveal more and more benefits and features and get the person to start using it without even realizing they are.

This is the “unconscious adoption of a product”.  Think of it as seducing your user.

At a certain point, the user crosses what I call the Product Event Horizon.  The Product Event Horizon is an invisible line that users hopefully won’t realize they’ve crossed but which they can never pass back across again.

(Read more about Event Horizons on Wikipedia if you want to know more about why I chose this term and geek-out on blackholes for a bit.)

Your company’s job is to push the Product Event Horizon out as close to possible to the first touch with your potential user and to make passing over it as unnoticeable as possible.  i.e. people start using your product without even realizing they are and before they can stop, they’re hooked.

To use a more plebeian analogy, the Pringles slogan had it right – “once you pop, you can’t stop”.

What to do

So, how do you actually make this change? Here are some pointers:

1.  Make sure everyone understands your funnel
Everyone in your company should understand the series of stages that a potential user goes through from first touch with your company to being an active user and/or paying customer.

More specifically, make sure everyone understands the conversion rate at each stage of the funnel – i.e. what people % of people advance to the next stage rather than drop off.

2.  Measure with tools
As the saying goes, you can’t manage what you can’t measure.  More specifically, you don’t know what changes help if you can’t measure their effects.

Another issue here is that SaaS companies are usually dominated by engineers and engineers generally hate “marketing stuff”.  They argue endlessly with sales and marketing over what’s important in the product.

However, engineers are generally suckers for facts and the scientific method.  If you show them actual data showing what users click on, how they make there way through the product from their first touch and where they drop off, there’ll be much less argument over what’s important to fix.

There are loads of tools out there but here are three of my favorites:

CrazyEgg – click-tracking – presents a visual “heatmap” of where people click and what they scroll to
Optimizely – predominantly an A-B testing tool but also tracks clicks
Google Analytics – the obvious choice

3.  Make sure you can track users all the way through your product
An important step in the joined-up thinking and elimination of the distinction between “product” and “marketing stuff” is the ability to track a user all the way through from their first touch to their ongoing use of your product over time.  Don’t let data about conversion rates through your funnel stay separated or get separated from data about usage of your product.

4.  Get your head around and use Cohort Analysis
Cohort Analysis allows you to compare the behavior of your users based on how long they’ve been using your product rather than when they started using your product.  For example, it allows you to easily answer the question, “during their 2nd month of usage, how much did users who joined in January use the product versus those who joined in August?”

There are many articles out there on Cohort Analysis which explain what it is and why it’s important. Try starting here:

http://themetricsystem.rjmetrics.com/2009/09/09/cohort-analysis-in-rjmetrics/

5.  Invest in a Content Management System
A good Content Management System (CMS) will allow tweaks to the text, images, videos and, to some extent, layout, throughout your site without having to dive into raw HTML or source control.

This significantly decreases the time to make such changes and increases the number of people who are able to make them.  In turn, this means they can be tweaked much more frequently.

Importantly, don’t fall into the trap of only using a CMS for the “marketing stuff” and not for the “product”.  It should be easy to tweak language and layout throughout your whole site.

6.  A-B test as a matter of course
A-B testing is a habit you have to get into, rather like test-driven development.  A-B testing lets you answer the question scientifically as to whether a change you make has a positive benefit.

One note of caution is that A-B testing can only be effective once you have a certain volume of hits/users – you need enough volume in order for the comparison to be statistically significant. Premature A-B testing is a form of premature optimization that can hinder rather than help.  A-B test with too few hits/users and you’re trying to read tea-leaves, rather than apply the scientific method.
Fortunately, good A-B testing tools also let you know when you have enough data for the comparison to be statistically significant.

7.  Have a regular data meeting
This is the meeting where you review the data on how your company is performing.  It’s the meeting that engages everyone in driving the company by the numbers.

Ideally, have this meeting weekly.  In a small company, make it an all-hands meeting.  In bigger companies, make sure that there are representatives from all areas including, importantly, actual developers.  Make sure that no one can stick their head in the sand and get disconnected from the reality of your business.

Make it the most important meeting of the week.  It’s the heartbeat of your company.

The raw inputs are all that data you are collecting through the approaches above – funnel conversion rates, hits, click-tracking, A-B testing results, etc.

However, identify a small number – some say less than 10, others say only 1 – of metrics that you focus as the true indicators of how your business is doing.  You can dive into others as required.  Try to review too many data points and you can’t see the wood for the trees, the meeting drags on and people start to think of it as a chore.

8.  Hire a marketing engineer
Or, because these people are hard to find and are highly prized, convince someone internal to become your marketing engineer.

Marketing engineers bridge the gap between the marketing activities and software engineering – they live and breathe meta-data, tags, SEO, viral co-efficients and conversion rates.

On the face of it, developers should naturally gravitate towards this work since it’s hard, involves tinkering and is data-driven.  However, many developers still shy away from it because it smells of “marketing stuff”.

Agree, disagree?  Please leave a comment. (Hint: the link to comments is hidden at the top of the article, underneath the title.)

Why You Should (Almost) Never Rewrite Code – A Graphical Guide

I’m by no means the first person to write about the dangers of rewriting code.  The definitive work for me is “Things You Should Never Do, Part I” written by Joel Spolsky in 2000.  If you haven’t read that, you should.

A recent discussion caused me to create a series of charts to graphically illustrate the dangers of rewriting.  I tend to think graphically – blame too much time in Powerpoint creating VC pitch decks.

I hope these charts help anyone considering rewriting code or being hectored by earnest, bright, young engineers and architects advocating a rewrite.  I’ve seen this movie before and I know how it ends.

The Status Quo

Firstly, here’s the status quo:

The more time and money you spend on an existing product, generally speaking, the more functionality you get.

Let’s then overlay the competitiveness of the product in its target market.  Of course, what you want to achieve is a continual improvement in the competitiveness of the product.  Competitiveness doesn’t increase as fast as functionality.  Your competitors don’t stand still so, typically, the best you can hope for is to increase competitiveness gradually over time – even staying flat is a big challenge.

Of course, this chart is idealized – functionality will increase in a more lumpy way as you release major new chunks of functionality and competitiveness will move up and down against your market. However, they demonstrate the point.

Note:  the Y axis on all these charts represents “functionality” which, for the purposes of this discussion, can be considered a blend of features and quality.  The distinction between the two is not really important in this analysis since you always want to be advancing on one or both and they both impact overall product competitiveness.

Let’s Rewrite!

Cue your software architect.  He’s just been reading about this great new application framework and language called Ban.an.as – it’s so much better than the way you’ve been doing things previously. Hell, Ban.an.as has built-in back-hashed inline quadroople integration comprehensions. Plus, all the cool kids are using it.

If you’re a non-technical manager or executive, this can become quickly overwhelming and hard to argue against.  They’re the experts, right, so they must know what they’re talking about.

[By the way, if you’re a non-engineer, there’s no such thing as “back-hashed inline quadroople integration comprehensions” – I made that up.  Sorry.
A little secret here: there really haven’t been any new programming paradigms invented since the 1970s.  Software folks are generally in their 20s and didn’t see them the first time around – they just get “re-discovered” and given new names. Sssh – don’t tell anyone.]

Just to be clear – I’m not saying that new languages, frameworks and technologies can’t create significant improvements in developer productivity – they can.  But, their introduction into an existing product has a big price, as we’ll see.

Lastly, lest I alienate or offend my fellow geeks, I have been that very software architect advocating for the rewrite.  I learned this the hard way.

So, this is how the rewrite is supposed to work in theory:

Let’s break this down:

The rework is expected to take some amount of time.  During this time, functionality won’t increase because developers are focusing on rebuilding the foundations.
In the graph, that’s the blue area you can see peeking through.  That blue area represents the cost of the rewrite.

But, once the rewrite is done, the idea is that progress will be massively greater than it was previously because the new technology used is inherently better than the old.  Developers will be more productive with the new.  There’s no need to work with the old spaghetti code – instead, there’s a beautiful new architecture free of all the baggage that came before.

The critical point in time is the break-even point – this is the point at which the functionality of your product starts to exceed where you would have been had you stuck with the original implementation and continued working on it.

During the rewrite period, the competitiveness of your product will typically decline since your competitors are not standing still and you can’t develop new functionality.

However, the claim typically made by the rewrite advocates is that the rework will be relatively easy, take a relatively short period of time and hence achieve break-even quickly, after which it’s non-stop to the moon…

What tends to go wrong – Part 1

So, what tends to go wrong?  The most common problem is arguably the most common problem in software development generally; the rewrite takes significantly longer that expected.

There’s a discussion of why this tends to happen below but, for now, trust me that this often happens – if you’ve had any experience with software development at all, it’s highly likely that you’ve seen this happen too.

The result is that the cost of your rewrite is significantly larger than originally claimed.  (The blue area showing through on the chart is now much larger.)  This means that the break-even point is also significantly pushed back in time.

The knock-on effect is that the competitiveness of your product drops for a much longer period of time.

If you are a big company, you can probably (hopefully) absorb the pushed out break-even point – maybe other products provide revenue, maybe good channel relationships continue to deliver sales of your product even though it’s falling versus the competition or maybe you’ve simply got lots of cash reserves.  Joel Spolsky references several big company rewrites that failed but did not kill the company.

However, if you are a startup or smaller company (or even a less fortunate bigger company), this can be – some might argue, is very likely to be – fatal.

What tends to go wrong – Part 2

It gets worse.

Not only does the rewrite often take longer than expected but functionality is not even flat at the end of it – functionality is actually lost as a side-effect of the rewrite.

That’s because all of those small but important features, tweaks and bug-fixes that were in the original product don’t get reimplemented during the rewrite.  (These are the “hairs” that Joel discusses.)

Remember that the main focus of the rewrite in the developer/architect’s mind is generally to build a better architecture and these small features don’t seem important and mess up this beautiful new architecture.

Plus, however good the developers are, they will introduce new bugs that will only get exposed and fixed through usage.

The net result is that the product after the rewrite is, in the eyes of the end-user and the market, worse than the product before the rewrite, even if it’s better in the eyes of the developer.

This further pushes out the break-even point in terms of functionality and competitiveness of your product will take a long time to recover.  If you listen carefully, you can probably hear your competitors wetting themselves laughing at your folly.

What tends to go wrong – Part 3

Oh dear.

The nail in the coffin is that, not only does the rewrite take longer than expected, and functionality get lost in the process, but the benefits of the new technology/language/framework turn out to not be nearly as great as claimed.  Meanwhile, if you’d stuck with the status quo, you would have got more productive due to normal learning effects – i.e. don’t forget that while your team is climbing the learning curve with the new technology, you would have been getting better with the old one anyway.

Any one of the 3 problems above is potentially fatal but all 3 together is definitely so.  Competitiveness of your product will likely never recover.

Why does this happen?

So, the above sections discuss what can go wrong.  It might help to understand why this happens.

In Joel’s seminal post cited above, he makes the point, “It’s harder to read code than to write it.”

Very true – it’s also more fun to write new code than learn someone else’s code.

Developers like to feel smart and, intellectually, learning someone else’s code can seem like a lose-lose scenario to a lot of developers – if the code is bad, it’s painful to learn and you’re going to have to fix it.  On the other hand, if it’s better than you would have written, it’s going to make you feel stupid.

Also, bear in mind that the fundamental motivation of most (not all) engineers is to Learn New Stuff ™.  They are always going to gravitate towards new things over old problems they feel they’ve already solved.  Again, I’m not faulting developers for this – it doesn’t make them bad people but, if you’re a non-developer, it’s critical you understand this motivation.

Put it this way: would you rather be the guy that architected the Golden Gate Bridge or one of the guys hanging off it on a rope, scraping off rust and repainting it?

Another problem is that when you rewrite, you typically make rapid progress early on which gives false validation to the decision to rewrite.  It makes you feel smart – what a beautiful cathedral I’m building.

That’s because you’re writing code in a vacuum.  No one is using the code yet; certainly no actual users.  But, as you start to reach launch date, all those small features, tweaks and bug-fixes – all that learning that was encapsulated in your old product – starts to become conspicuous by its absence.

The bottom-line is that, when the case to rewrite is being made, it is not comparing apples to apples – it is comparing theoretical benefits with actual benefits.  The actual benefit in question being, of course, that you have an existing product that works.

Comparing the pros and cons of writing a new application in language A versus B is not the same as comparing an application already written in language A versus rewriting that application in language B.  Why?  because any productivity gains of one language over the other are typically massively overridden by the loss of all the domain knowledge, testing and fixes encapsulated in the existing product.

Should you EVER rewrite?

So, are there ever circumstances when you should rewrite?  My answer here is an emphatic“maybe”.

Let’s consider some of the possible situations:

1.  An irretrievably sick code-base
The symptom here is that it takes exponentially longer to add each new feature – per the chart above.  Another symptom is that defect reports continue to come in as fast, or faster than you can fix them – you’re treading water.
However, an irretrievably sick development team is a much more likely culprit than an irretrievably sick product.
Don’t let developers convince you that they can’t maintain a codebase – what they most often mean is that they don’t want to maintain a codebase.

2.  The developers who wrote the code are not available
If you buy/find/inherit a codebase, make sure you have access to as many of the developers who wrote it as possible, for as long as possible.  If you didn’t…doh!
Again, don’t fall into the trap – developers will always prefer to write new code of their own than learn how the existing code works.

3.  A genuine change to a new problem domain
Sometimes, some of the fundamental assumptions and technology choices may no longer be valid for the problem domain that your product is addressing.  But, then I’d argue, you’re really talking about building a new product rather than rewriting an existing one.

4. Fundamentally incorrect or limiting technology choices
In some cases, the team that originally built the product may have made some poor choices in the technologies to use or the approaches to take.  They may simply not map well to the problem domain of your product.  However, in my experience, this is true much less often than developers claim it’s true.
Also, there are points where you start to hit fundamental scalability limits of certain technologies.  However, keep in mind that if you’re hitting those scalability limits, someone else probably has too before you, and solutions to the problem exist.

So, if you are even entertaining the suggestion of a rewrite, make sure you get the developers to give you a specific cost-benefit analysis of the rewrite.  Show them the charts above and get them to tell you why these problems won’t occur in this case, even though they occur in almost every case.

If and when you are convinced that this is one of those rare situations where a rewrite is the right approach, you need to make it surgical:  where will you make the incision?  How deep do you cut?  What are the risks?  What are the potential side-effects?  How can I make sure no functionality is lost? How can it be done incrementally?

Divide the rewrite into a series of smaller changes, during which functionality absolutely cannot be lost.  Rewrite parts of the system at a time with a well defined, understood and testable interface between old and new.

Better still, don’t rewrite.

Good luck.

Agree, disagree?  Please leave a comment.