To keep the code simple, you need to keep the following in mind:

  • No over-architecture
  • No unused/commented-out code
  • Only code for the current use cases
  • Use built-in types or methods as much as possible
  • Use complex design pattern only if needed, e.g. avoid dependency injection if there is no clear benefit
  • For API, keep it simple with no configuration or parametrization first.
  • Add options for more complex and flexible use cases as needed.

Do Not Over Architect

The first step of building software is to design it. As the design process is progressing, it is important to pause for a minute and ensure that the architecture is still simple. Architecture needs to be simple even if the project itself has very complex usecases. Complexity of projects become simple as the design is broken to it's smallest part. Keep your code modular; each module does one thing and one thing only. Follow the coding principles and even the most complex designs can become simple.