2.1.1 (b) The need for abstraction

Why is abstraction necessary?

Modern computational problems and systems are often too large and complex to understand or solve in full detail at once. Abstraction is necessary because it allows computer scientists to manage this complexity by focusing only on what is relevant at a given stage.

Without abstraction:

  • Systems become difficult to understand

  • Errors are harder to identify

  • Solutions are harder to design and maintain

Abstraction enables problems to become tractable – meaning they become solvable in a reasonable amount of time.

Managing complexity

Real-world problems typically involve:

  • Large amounts of data

  • Multiple interacting components

  • Many possible states and edge cases

This allows us to break problems into simpler representations and work with models where reality might be too complex. We can also delay the implementation of details until they are needed – too often we jump in and try and tackle everything at once, but it is often better to focus on one thing fully.

Abstraction with reuse and generalisation

Abstraction allows solutions to be reusable across different problems. It can also be generalised rather than case-specific. An example would be if we wrote a function to calculate the area of a rectangle, rather than one to calculate the area of a rectangular desk. It’s a subtle difference, but by using abstraction we can write code that more appropriately fits a variety of use cases, and is therefore more useful across the board.

By distilling systems to their lowest levels, we also provide improved communication – algorithms expressed in pseudocode, or system diagrams are uniformly expressed, so that teams can collaborate more effectively and stakeholders can understand systems without technical detail.