That's a solid philosophy
You've heard of SOLID right? Of course you have, how silly of me. {dramatic pause while you look it up in case you need a refresher. It's L isn't it? It's okay. Don't feel bad. Nobody ever remembers L. No offense to Barbara Liskov. I mean, it's probably not you. }
So. You read the definition and it sounds good, but meh, maybe next month. You're too busy for this right now. Yeah! I get it. I'm busy too. I'm busy because people make decisions that defer bad behaviour to a later version of themselves. This means that the problems I have right now are my own fault, and the sins I committed years ago are the deferred costs that have come due to make me busy today. Even better, the poor decisions I'm making now in response to the poor decisions I made in the past are going to haunt future me sometime later, thus perpetuating this cycle.
Is SOLID the solution to the worlds development problems? No. Pfft. Don't be ridiculous. Unit testing is obviously the solution to all problems. But SOLID can help you put less of a burden on future you by helping you to identify when you're actively hurting yourself. In the future, I mean.
I'm reminded of this because today, I was wronged by an earlier me. I did something fast because it had to get done, and I knew it was wrong, but pressure and deadlines and insert well meaning excuses here. I managed to make a class that wasn't S, or O, or L. I and D don't really apply here so I am clearly S.O.L. Why did I do this? See above well meaning excuses. The thing is, blame doesn't get things done.
I had a discussion with my peers. We could choose to break the cycle and incur the cumulative past debt of our (in particular, my) bad decisions, or we could kick the ball down the line. One creates a lot of work. It probably breaks a lot of stuff. It likely introduces a few more bugs we'll discover later as well, but it's the right thing to do and it leads to better code. The other, well, isn't a particularly solid choice.
I'm writing this article not to encourage you to accept the debts of your own past selves, but to tell you that when you finally end up doing things right it isn't nearly as bad as you think, and it will help you make better decisions in the future. I had a colleague recently worry about the cost (effort) of implementing some tests on some previously untested code. I suggested that SOLID (and some other tools courtesy of Michael C. Feathers - Working Effectively with Legacy Code) could help the team start to undo the coding sins of the past and in the process, end up with a better design.
You need to resist the temptation to fix problems you haven't hit yet. Ever heard of premature optimization being bad? Well, premature design is a cleverly disguised version of it. Don't break dependencies until they're in your way. Don't design interfaces until you know what they need to be. Don't create abstractions because you think something will need it in the future.
Recommended by LinkedIn
Flipped a table just now did you? Well put it back because I'm right. I don't design for problems I don't have for multiple reasons, but here are the biggest.
1) I don't have that problem yet. That thing I think is 100% certain to happen may never happen.
2) If I SOLIDly apply solutions to problems I actually have now, my code will be easy to change if and when I ever need to.
3) Unit tests have my back when I do change the code to make sure it still works the way it was expected to work.
I know that if I stop cheating my future self, the fear of the cost of change goes away because I've already paid it when it was still small - however enormous it might have been on the day it was when I decided to pay it. Debt doesn't get smaller without repayment. Ever. The next time you're saying to yourself "I don't have time to do this right.", it's probably because you already said that before.
Step back. Think about what you're doing and see if you can evaluate how SOLID it is. It may sound silly but these five letters help to guide you toward betterness when you're at your most vulnerable. A lot of the time people don't know what else to do, so they do the thing that gets them into the most trouble later on. Take a minute, and give yourself a break. You don't have to be an angel and do everything right. If you are a little better than you were last time, the burden will slowly ease to a point where you aren't so easily tempted to be your own worst enemy.