Marcus Orochena

Keeping things simple

Software Development Principles

2021-07-18

Recently, a subset of our development team sat down to discuss challenges we face while coding. We explored areas in our codebase that were difficult to work in and brainstormed ways to improve the situation. From this open discussion, we identified key software development principles that resonate with us.

There are plenty of books written on the subject, but we condensed a lot of that knowledge into the points that felt were most important. We've organized these into two Universal Principles that serve as overarching guidelines for writing better code, which are supported by the principles underneath them.

  1. Minimize Complexity: This principle is at the heart of our discussions. Minimizing complexity reduces the cognitive load for developers, making the codebase easier to work in.

    • DRY: We found that avoiding repetition helps, but also acknowledged that sometimes repeating code can actually reduce complexity.
    • YAGNI/KISS: Our team noted that over-architecting solutions, especially for features that are new and prone to change, increases complexity.
    • Minimize Leakiness: We realized the value of abstractions diminishes when they introduce more complexity than they remove.
  2. Optimize for Readability: A unanimous agreement was that code is read more often than it's written. We believe in optimizing it for human understanding.

    • Be Explicit: We felt shortcuts in naming often backfire in the long run.
    • Context in Naming: Our team believes that descriptive variable names alleviate a lot of confusion.
    • Conditionals into Variables: This simple practice made our code more readable and easier to debug.
    • Single-Responsibility Methods: We agreed that focusing a method on a single task improves maintainability.
    • Level of Abstraction: Keeping methods at a single level of abstraction made them easier to understand and modify.