The Object-Oriented Dilemma: How Bad Generic Abstractions Can Make Developers Inefficient?

Jean Reinhold
2 min readApr 19, 2023

--

Developing software is not a simple task, especially when it comes to large and complex projects. To deal with this complexity, many developers opt to quickly create generic and scalable abstractions with the intention of making the project progress more rapidly. However, this approach can lead to serious problems later on.

The first issue to consider is that often these abstractions are created without a complete understanding of the problem being solved. Without a deep knowledge of the problem, it’s difficult to create an adequate solution, and attempting to create generic abstractions can actually further complicate things. Instead of speeding up the project’s progress, lack of clarity can lead to an increase in time and resources needed to create an adequate solution.

On the other hand, object-oriented programming can be a powerful tool to accelerate software development and enable code reuse in other projects. However, creating generic abstractions is not the only possible approach. Instead, it’s important to focus on the user and understand what’s important to them.

To do this, it’s important to follow the KISS and YAGNI principles. The KISS principle (Keep It Simple, Stupid) is a basic design rule that suggests that the simplest solutions are usually the best. This means that instead of creating complex generic abstractions, it’s better to create simple and effective solutions that meet the specific needs of the user.

The YAGNI principle (You Ain’t Gonna Need It) suggests that developers should not create features or functionalities that are not necessary to meet the current needs of the user. This means that instead of trying to create complex solutions that may be useful at some future point, it’s better to focus on the immediate needs of the user and create simple and effective solutions to meet them.

Additionally, it’s important to maintain an entrepreneurial outlook as a programmer. This means that developers should always be on the lookout for opportunities for innovation and improvement, but also be realistic about what’s viable and practical in the context of the current project.

In summary, while creating generic abstractions may seem like an attractive solution to speed up software development, it’s important to keep the focus on the user and follow the KISS and YAGNI principles to create simple and effective solutions that meet the specific needs of the project. By adopting an entrepreneurial approach, developers can find opportunities for innovation and improvement while remaining realistic about the project’s limitations.

--

--