I mean I'm not working on big code bases anymore, more tooling, analytics and managment. But both the open/closed principle and some advice from Sandy Metz and others really stuck with me: Don't bother abstracting.
Just write straight line code.
And then introduce indirections and abstractions if good reasons demand it. In fact, if changes to the code demand it.
For example, introducing an abstraction for an external database can improve testing prospects. If you need to fix the same bug in several places, it's usually time to extract a common abstraction. If you need to touch some established piece of code to introduce a choice what kinda algorithm/strategy/formatting/.... you need to use here, that's a decent point to introduce some abstraction and to inject some function/object here. If you would have to replicate the exact complex logic from somewhere else, and those places need to move in sync for reasons, moving that to a common place is probably a good idea.
Just following what the code needs and the changes and requirements around the code need has resulted in much simpler code and way more effective abstractions for myself.
Just write straight line code.
And then introduce indirections and abstractions if good reasons demand it. In fact, if changes to the code demand it.
For example, introducing an abstraction for an external database can improve testing prospects. If you need to fix the same bug in several places, it's usually time to extract a common abstraction. If you need to touch some established piece of code to introduce a choice what kinda algorithm/strategy/formatting/.... you need to use here, that's a decent point to introduce some abstraction and to inject some function/object here. If you would have to replicate the exact complex logic from somewhere else, and those places need to move in sync for reasons, moving that to a common place is probably a good idea.
Just following what the code needs and the changes and requirements around the code need has resulted in much simpler code and way more effective abstractions for myself.