Simplifying Software

The Top Seven Ways to Simplify Software Development

  1. Embrace Test-Driven Development (TDD). Writing tests first ensures that the code is testable.  By definition, testable code is infinitely simpler than untestable code.
  2. Utilize an automated build process to perform continuous integration. Magic happens when continuous integration catches a problem within moments of it being committed.  The offending issue is usually obvious and easily resolved, obviating the need for long, drawn out sessions with a debugger.
  3. Write clean code. Read  “Clean Code: A Handbook of Agile Software Craftsmanship” [Amazon page] by Robert Martin and follow his advice.  Even if you get no further than the first, tiny piece of advice — to stop using abbreviations in the names of program elements — it will make your code much cleaner and easier to follow.  Keep reading and applying Martin’s advice and pretty soon your code will be cleaner by orders of magnitude. The best virtue of clean code? There’s less places for bugs to lurk.
  4. Ruthlessly remove dead code. Do not commit commented-out code.  Delete unused code immediately and rely on your version control system to retrieve it if necessary.  (You do have a version control system, right?)
  5. Ruthlessly remove speculative code. Do not commit code that isn’t being used right now.  If you are really concerned that the code might be valuable sooner or later, then save it off in a clippings library for later reference (either a clippings library that you maintain personally and informally, or one that is maintained formally by your institution), but get the speculative code out of the active system.
  6. Understand and obey the “SOLID” Principles of Software Design:
    1. Single Responsibility Principle [Wikipedia definition]
    2. Open Close Principle [Wikipedia definition]
    3. Liskov’s Substitution Principle [Wikipedia definition]
    4. Interface Segregation Principle [Wikipedia definition]
    5. Dependency Inversion Principle [Wikipedia definition]
  7. Know the top 10 or 20 design patterns and learn to recognize when they ought to be used. For example, it’s amazing how an extremely complicated piece of code can be simplified if the Null-Object pattern [Wikipedia definition] is called for.

Click here for more articles on Simplifying Software

a blog by Craig L. Jones, Software Agilist