Programming first principles - 3. Requirements of software

Video version of this article: https://youtu.be/tCdNyce-shQ

This article is part of the "Programming first principles series":

  1. Purpose - What this series is about
  2. Audience - Who this series is for
  3. Requirements of software (this article)
  4. Premise - Minimal information
  5. Premise - We must understand what we're doing
  6. Premise - Minimize propagating changes throughout the system
  7. Premise - Complexity increases exponentially with scale
  8. First principle - Proof that code works
  9. First principle - Principle of least astonishment
  10. First principle - Principle of least knowledge
  11. First principle - Separation of concerns
  12. First principle - Abstraction
  13. Side effects

Also suggested:


Now we get to the good stuff.

We need to start with what it is that we even want in software.

Let's start with the definition.

Definition of software

"Software" is a combination of two words:

  • Soft
  • Ware

Soft means malleable, easy to change etc. In our case, it means that the code we produce must be easy to change.

Ware means a product, goods, etc. In our case the product we produce is a system of code.

Requirements

Both of those words perfectly describe our requirements / what we're aiming to achieve when making software:

  • A system of code.
  • Which must work as intended.
  • Which is easy to modify.

Explanation for our requirements

The "ware" part should be pretty clear. Obviously we produce systems of code and the product has to work as intended.

The "soft" part may not be immediately obvious. So I'll try to explain it a bit more.

Code needs to change all the time, for many reasons.

  1. Requirements change all the time.
  2. While developing the code in the first place, we do not know its final form. We constantly re-design and re-write it.
  3. Software needs constant maintenance and improvement, both in terms of bugs and new features.

Because it needs to change so often, we must make sure it is easy for us to change.

Here are the reasons code needs to change in more detail:

Requirements change all the time

This is just how it is. Stakeholders come up with new features or changes they want. Scope creep is a common occurrence. See feature creep and scope creep.

We constantly revise the code during development

This is how we work.

If we could design the code upfront perfectly and then just write it, we would be done significantly faster. We would also use waterfall and be happy.

This is one reason why small development cycles are very helpful to us, which agile advocates. It's just the nature of our work that we constantly need to revise our code and modify it.

Gall's law also supports this. It essentially states that we can't create a system of code in one go, we have to continually revise and build it up.

Software needs constant maintenance

Even after initial development is finished and the stakeholders have accepted the product, software still needs constant maintenance and improvement. See software evolution.

Conclusion

Our requirements are:

  • A system of code.
  • Which must work as intended.
  • Which is easy to modify.

This article is part of the "Programming first principles series":

  1. Purpose - What this series is about
  2. Audience - Who this series is for
  3. Requirements of software (this article)
  4. Premise - Minimal information
  5. Premise - We must understand what we're doing
  6. Premise - Minimize propagating changes throughout the system
  7. Premise - Complexity increases exponentially with scale
  8. First principle - Proof that code works
  9. First principle - Principle of least astonishment
  10. First principle - Principle of least knowledge
  11. First principle - Separation of concerns
  12. First principle - Abstraction
  13. Side effects

Also suggested: