So, I'm an experienced dev with more than 10 years of experience. I do mostly web development.
Every once in a while, I catch myself obsessing about architecture. It usually goes like this: I got some free time, I start to think that my current code sucks and that I need to rewrite it "the proper way".
This usually means proper separation of concerns, layers, abstractions and what not. I'd go crazy with that. I get troubles sleeping, I get very stressed mainly because I want to do it quick so I could go back to actually adding features and fixing bugs.
This mainly apply to my side projects, as at work I rarely have the luxury to rewrite stuff or introduce big changes. But it's really bothering me. For example right now I have an app that makes some money and I want to scale it by adding more features. But I got caught into this architecture obsession and so I want to rewrite it because right now there are no abstractions whatsoever. HTTP requests comes in, I do raw sql queries and get shit done. But I want to make it nice, have clean architecture, onion architecture, proper domain layer. But none of this matters. It's a one man show, and it works.
And yet, I got stuck in this mode for the past couple of days, and I can't seem to get out of it. The sad thing is that I start the refactor, realize midway that I did not think it through, waste a day of my life, go to sleep, and repeat the same tomorrow thinking that I have found a "better way" to do it, just to make the same mistake again in a different place.
How do I stop being obsessed with software architecture and actually focus on getting shit done?
Good engineering is not about good code. Good engineering is about taking the actions you need to take to solve a problem while minimising costs. Usually the problem is making money and usually the biggest expense is time. Writing good code can be useful but knowing when not to spend the time makes you a better engineer.
Our school took us to the engineering department at the local university for a taster day. They challenged us to build a wheeled robot which could cross a swimming pool in the shortest time possible. I got together with my geeky friends and at the end of the day we proudly presented our clever tower of gears robot which kept the motor above water while transferring power to the wheels
The trouble makers in the class also teamed up and spent the whole day throwing around bits of Meccano at each other and at us. As the teachers announced end of time they quickly attached a couple wheels to their motor and called it a day.
When it came time to race, their entry sank straight to the bottom, hit the floor and sped across to the other side before ours had a chance to get its coat on. They won by a large margin, and for good reason! None of us had thought to wonder if the batteries and motor could run under water, it would only need to do it once and last say 30 seconds, none of us had questioned the requirements and we’d spent the day building something slow and complicated. If I find myself spending too long on abstractions and not the problem I think back to this