how many times you have started a side project to address a simple idea, but after few days a lot of things have come to your mind and you wanted to make it perfect, and whenever you think about a small enhancement or a feature you think about why don't we make it more better or increase the scale to include more things.
this is called overengineering, it's not only limited to side projects or ideas that comes to your mind but also it can extend to your daily tasks.
for example if you want to create a simple login service which has a clear requirements, you start asking why don't we add MFA for example , or external login provider or even integrate with SSO server.
sometimes this thoughts are good as it widen your vision and can reveal some hidden or forgotten requirements but it's also can be very overwhelming, as this adds complexity to your task, cost, bugs, scalability issues or Unnecessary features.
How to avoid overengineering ?
- KISS Principle (Keep It Simple) don't try to add more things to your solution before making sure that it's really requirements.
- Clear Requirements to be able to apply KISS principle properly you need to have Clear Requirements
- Refactoring regularly review and refactor code to eliminate unnecessary complexity as refactoring helps maintain a clean and maintainable codebase without compromising functionality.
- Avoid Premature Optimization avoid optimizing code or introducing advanced features prematurely. Optimize only when performance issues are identified through profiling or when necessary for scalability.
- Pragmatic Design Patterns choose patterns that align with the project's needs, as design patterns can be beneficial, applying them excessively or inappropriately can lead to overengineering.
Always amaze people arguing of using architecture, technologies or trending solution before studying the problem domain. The abuse of "use of API" for everything, microservice architecture, containerized solution and so on... are the most frequent nowadays.