Live data from Hacker News

Ask HN: How do I stop being obsessed with software architecture?

news.ycombinator.com

21–30 of 38 posts

Re: Ask HN: How do I stop being obsessed with software architecture?

#21
Focus on incremental improvement. You don't have to rewrite the entire system to improve the architecture. As with many things, moderation is the key: if there's something blocking the actual work you need to get done, give yourself an hour or two to refactor it enough to do the thing, then go do the thing. It doesn't always have to be 1:1, but if you tie a refactor to the actual thing you need to get done (and you keep it very small and self-contained), then you'll always at least be doing something.

Re: Ask HN: How do I stop being obsessed with software architecture?

#22
Your problem is that you don't have a termination criterion, so I propose this:

1. Write the product and tech specs. This lets you know when your work is done.

2. Propose an architecture that meets it, and move on. Don't overengineer it.

3. Implement the architecture.

Re: Ask HN: How do I stop being obsessed with software architecture?

#23
It could be that you have an anxiety disorder, obsessive personality disorder or OCD. Or perhaps not, but the obvious red flag is trouble sleeping. If you’re typically a good sleeper but find yourself sleepless when in one of your spirals it's a good indicator that you need to take a step back, take a deep breath and reset your mental state because its not the refactoring thats not letting you sleep its all the stuff that you have built up in your head.

Also complete rewrites in general are overwhelming and tend to turn out not the way you imagined anyway. Small incremental improvements and isolated refactors over a sustained period of time yield the best results.

Re: Ask HN: How do I stop being obsessed with software architecture?

#25
Do you enjoy it? If so, maybe consider a role where this is a key contribution. It sounds like at some level, you're good at it and naturally inclined to think this way. If you enjoy it lean into it and be excellent.

Where things get difficult is if you're trying to be a founder/creator and you have perfectionist thinking. That gets you into a negative cycle where you're neither productive (velocity) or satisfied with quality. You have to learn to detach yourself from judgement and focus on actions that drive more important outcomes.

Re: Ask HN: How do I stop being obsessed with software architecture?

#26
I have the same issue. I personally recommend to do "things that don't scale". Just continue to pump out features and make more money. Do not worry at all about scaling, in fact, ignore it.

Why?

1) It's extremely unlikely that you will actually hit a major issue because of scale or wrong software architecture which will bring your system down

2) Even if that's the case, it will probably be easy to fix it when it happens because the issue will be clear, whereas in hindsight you are trying to solve 1000 architecture issues without actually knowing what will come up

3) Even facebook and google probably had problems in the beginning of their startup life. Even if your system crashes and is down for a day or two (for non mission critical apps obviously), it's not the end of the day, nor will in matter in the medium or long term, and probably not even in the short term. I can tell you I worked at a unicorn startup with government and bank clients which are usually the most strict, and that kind of stuff happened all the time... so unless it's mission critical and/or you are dealing with extremely strict customers, it doesn't make a difference

4) After coding a bunch of features, patterns emerge by themselves. Very often I do early optimizations that end up not actually being so useful since I have to add new features that work in a way the current well thought of architecture doesn't allow. I think I got it from Joshua Bloch's book or ppt/pdf on designing APIs that it's better to actually work with 3 (magic number, but I attest from personal experience that it should really be a minimum) actual use cases before designing an API. Same for architecture, by focusing on it before the code, it ends up having to change later on anyways, and we end up optimizing for non issues and loosing flexibility where it is needed. However, after you code enough features, you see where you've repeated yourself, that's not a major insight, and abstracting those or encapsulating those repetitions that happen 3+ times is now trivial. You can then choose when you code your Xth (s.t. X>3) feature and you've encapsulated the repetitive code whether to refactor the first 3 features to use the new implemented encapsulation or just leave it as is because a) it takes time to refactor and b) if it works, don't fix it, though you may prefer to simply and quickly replace the repetitive code by whatever construct you made to keep the code consistent and so that the code itself should serve as an example of implementing features for yourself or other programmers in the future.

5) To continue on the 4th point, doing the architecture without knowing how the system will evolve (which is really impossible in software, we do not know how customers will react to features beforehand and what the needs will be) is basically impossible. I think that's where the stress comes from: You want the architecture to be good, but there's always a "it could be like this" "or the need could be different like that" "or we could have 5 different needs". It's endless, the software can evolve in so many ways and it's impossible to predict, so which way should you optimize? And each design takes time, hence the stress: you don't ave enough mental/time/etc resources to deal with all the potential needs. However, if you switch that to "I don't need to solve it before it comes up" all the stress goes away, and you can just try out new features.

If you do this, your revenue will (hopefully) grow, you will be more productive, your system will end up more robust and have better architecture (because it's always easy in hindsight and usually impossible beforehand), you will avoid stress, and be happier!

Happy coding, all the best :)

PS: The examples are the same usually for horizontal or vertical scaling and splitting things into microservices, and for a bunch of issues, I just picked a simple idea, but I do believe it's a general approach what I said in point 4.

Re: Ask HN: How do I stop being obsessed with software architecture?

#27
Architecture is supposed to be things that help you get the stuff done that needs to get done.

Don't confuse architecture with how many repos you have or how big your files are. If you do, you'll end up just moving deck chairs around on the Titanic.

Don't confuse architecture with using more logical blocks than you need to. Some people really like making a PizzaFactoryFactory when really they just need to call a constructor.

Let architecture be the patterns that help you do the next thing. If something works how it is, you don't need to refactor it. Especially if it's worked like that for a long time. Leave good enough alone.

Remember there's a reason why you did things the way you have done them. That's worth a lot more than having a "clean" architecture (which honestly means nothing. clean to one person is a mess to another).

If you're going to add features, do it, and make the new architecture choices there. You don't need to change the architecture of everything just because you want to add something. If you did, I'd say that's "bad" architecture.

Also, don't let the new tech hype fuel your desire to change everything according to the new hype. If you do new hype you'll not only have to change everything, but you'll end up with bugs from whatever the new hype is anyway. And you'll end up with the same product doing the same things anyway.

Post reply on HN