Abstract:
Learn the internals of your feature before diving deep into it. A good textbook example of this is Boost.URL.
Link:
https://swe-tips.compiler-explorer.com/z/Tcz8h35fK
Conclusion:
Notice how each component serves a purposes and does it cleanly?
So... next time you develop a feature, think of it in a way that fits your language and project.
For C++: STL wins here, there's Stepanov' papers online too, it helps understand the rationale behind it. For Java: Make use of interfaces, enums, etc. It shows separation of concerns and good code hygiene.