4 ms·
,,Dependency injection (the pattern, not the kind of framework) Encapsulation Polymorphism'' These were just thrown in, but they both make the code less read
by xiphias2 3y ago
,,Dependency injection (the pattern, not the kind of framework)
Encapsulation
Polymorphism''
These were just thrown in, but they both make the code less readable and less performant if they are not really needed.
In my experience while having separation of concerns is critical for software development, the only way to find the right interface for that separation is trial and error.
Iterating on the interface between layers is the most important part of software development.
- verdagon 3y agoThose first two principles help promote simpler and more stable APIs, which is a must for large projects with many teams. If you iterate on the interface between large enough layers, it ends up anywhere between "very costly migration" and "breaking change". In a smaller project though, then yeah, it's better to just refactor away one's woes. Like you said, if it's not really needed, they can have their drawbacks.