How to Write Valuable Code

From Malakooti, B. (2013). Operations and Production Systems with Multiple Objectives. John Wiley & Sons.

There is a difference between being writing code, and writing code that adds value to your organization. Let’s talk about that.

How do you define what is valuable? You have to know what the business goals are of an organization. Project managers will often tell you what they need in the form of requirements and in most cases they’ll give you an idea of priority as well. But there is sometimes something lost in translation when it comes to how it should be built.

So how should software be built? Some people will say “TDD or bust!” others “Ship early, fail fast.” I think the product life cycle is a business tool that can help us answer this question.

The Product Life-Cycle

The product life-cycle is a business model to help describe the different stages a product will enter over the course of it’s time in use.

From Malakooti, B. (2013). Operations and Production Systems with Multiple Objectives. John Wiley & Sons.

It is quite simple. There are four stages of a products life:

  1. Introduction — When the product is new and introduced, people are just starting to learn about it.
  2. Growth — When the product is rapidly growing and gaining traction, more and more people sign up everyday.
  3. Maturity — The number of users isn’t growing as fast but it is stable.
  4. Decline — The number of users is declining.

Software is a product. We don’t have to think in terms of sales, we can also think in terms of users. i.e. Sales might not apply if it’s an internal company tool or open source project. The point is, as you may have guessed, is that not all products are at the same stage, so not all software should be developed the same way.

Matching development with product.

A decision chart for development strategies.

If I could sum up the point of this article in a single sentence, it would be:

Take the stage of the product life-cycle into consideration when making architecture decisions.

There will be many opinions on the details, but here are some guidelines:

Tech selection at each stage.

  1. Introduction: use whatever your team is comfortable with. You want to move fast. You are not solving for scaling here!
  2. Growth: If you’re finding bottlenecks, consider replacing the tech at those points. In some occasions, a total rewrite might be necessary at this stage, depending on how much tech debt you took on in the previous stage.
  3. Maturity: You probably shouldn’t add any new tooling or tech at this stage in the ball game. What you have is tried and true. Introducing new unknowns could lead to unstability.
  4. Decline: If the tech is super old and a pain to work with, you could use a facade type setup with new tech to make working with the existing codebase easier. In most cases this is not worth it though.

Development style at each stage.

  1. Introduction: Make it work, and make it work fast. Hack away.
  2. Growth: Refactor the core and make the core stable, but continue to develop features rapidly.
  3. Maturity: Make everything stable. You’re probably not going to add too many features at this point, but if you do. Do them well.
  4. Decline: Keep the lights on, but only do the bare minimum to keep it going. Any work at this point will see limited returns on investment.

Testing at each stage.

  1. Introduction: Make it work, and make it work fast. Hack away.
  2. Growth: Refactor the core and make the core stable, but continue to develop features rapidly.
  3. Maturity: Make everything stable.
  4. Decline: Keep the lights on, but only do the bare minimum to keep it going.

Again these are guidelines, my goal for this post is to get devs to think about the business side of things. It will make your life easier and your non-technical coworkers happier if you are coding to their needs.

--

--

--

Web/Mobile Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeff Lombard

Jeff Lombard

Web/Mobile Developer

More from Medium

Your project plan will fail

Documentation before coding software

Principles of Empathetic Software Design

Pair Programming, Mob programming or none of the above?