Graduate Program KB

Chapter 2 - A tale of two values

  • Two different values

    1. Behaviour - what the code does, correctness
    2. Structure - How easy the code is to change
  • Many programmers believe that their job is to focus on behaviour and neglect structure

  • The difficulty of making a change should be proportional to the scope of the change, and not to the shape of the change

    • Proportional to the change to the domain model
  • Developers are given a stream of changes which pull the code in different directions

  • Code designed for one day's changes may not easily fit the next's

  • Architecture should be as shape agnostic as practical

The greater value

  • Structure is more important than behaviour
  • Good structure makes the code easier to change
    • Poor behaviour can easily be fixed
  • Poor structure with good behaviour will have poor behaviour when the requirements change
    • And will be hard to correct

Eisenhower's matrix

  • Priority
    1. Urgent and important
    2. Important but not urgent
    3. Urgent but not important
    4. Neither urgent or important
  • Architecture of the code is important
  • Behaviour of the code is urgent
  • Do not prioritise behaviour which is urgent but not important over important architecture
  • Business managers are not trained to understand the importance of good architecture - not their job
    • Responsibility of the software team

Fight for the architecture

  • Developers are stakeholders
  • You are responsible for the code quality
  • Need to fight for what you know is important