The Top Seven Ways to Simplify Software Development
- Embrace Test-Driven Development (TDD). Writing tests first ensures that the code is testable. By definition, testable code is infinitely simpler than untestable code.
- 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.
- 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.
- 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?)
- 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.
- Understand and obey the “SOLID” Principles of Software Design:
- Single Responsibility Principle [Wikipedia definition]
- Open Close Principle [Wikipedia definition]
- Liskov’s Substitution Principle [Wikipedia definition]
- Interface Segregation Principle [Wikipedia definition]
- Dependency Inversion Principle [Wikipedia definition]
- 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