chapter four
4 Software Engineering
In the Software Engineering at Google book, the authors describe software engineering as programming over time. In this section, we will expore fundamental concepts to keep a codebase healthy.
4.1 Premature Abstractions
First, let’s define a concept that you have probably encountered many times: abstractions.
Abstraction is the process of hiding complex implementation details by exposing only essential features and behaviors that are necessary for understanding or interacting with it. In simpler terms, an abstraction is a simplified representation of a concept.
Abstractions can take various forms, including:
- Interfaces: Hide the complexity of one or more implementations, providing a consistent way to interact with different underlying systems.
- Modules: Encapsulate a coherent set of functions or classes, offering a clear and simplified interface for interaction while hiding internal details.
- Functions: Abstract away the complexity within a block of code, allowing us to focus on what the function does rather than how it achieves it.
You may have already heard the term premature optimization. It’s a concept highlighted by Donald Knuth: