Don't design for future use cases unless they are known in detail (in which case they're not really future use cases anymore). Things you don't know, will change. Your extra effort may actually hurt you in the future. Better is to design for change. Keep everything modular. Keep your concerns separated. When something needs to change, you can just change that thing. When the whole basis of the system needs to change,…
Ask HN: How to avoid over-engineering software design for future use cases?
71–80 of 258 posts
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#72Re: Ask HN: How to avoid over-engineering software design for future use cases?
#73Earlier quoted context omitted.
Unit tests are absolutely fantastic during refactoring. I once had to rewrite a piece of code where nobody really knew what it did or what it had to do, and the original author just made some guesses about the intention. I started out by writing unit tests for everything, which became my handhold and documentation for what the system originally did. Then I started reorganising the code into a more structured and more…
I would argue that having a robust type system and some (not too many) end-to-end tests for your software makes unit testing almost completely useless overhead.
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#74Earlier quoted context omitted.
I would argue that having a robust type system and some (not too many) end-to-end tests for your software makes unit testing almost completely useless overhead.
Conventional type systems don't really help you when your code is pretty much just taking in vectors/matrices of floats and returning vectors/matrices of floats.
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#75> engineers go extreme in designing things/code for future cases which are not yet known They're afraid. Fear: If I don't plan for all these use cases, they will be impossible! I will look foolish for not anticipating them. So let's give into that fear and over-architect just to be safe. A bit of the 'condom' argument applies: better to have it and not need it than to need it and not have it. But the reality is that…
I have noticed people who are extra organized in real life, who keeps every single file in a right directories after download tend to have inclination for prematured code refactoring for future use.
If these guys become code architect then i end up doing so many unnecessary things. The fundamental assumption of the refactoring gets changed very fast and the code needs to be rewritten for the majority of the cases.
From a company level I find the instructions are clear, mostly holding the same contract between services as long as possible and less schema change.
Its the engineer with subjective idea of perfect code / supporting future work makes it even more complex
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#76In my experience, keeping behavior static/hardcoded is the architectural equivalent of avoiding premature optimization.
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#77My observation is that as I’m getting older as an SDE the number of classes I create in a project goes down! Like a lot of people in this thread point out: almost most of your code has to be changed anyway in a refactor no matter how clever and abstract the design is, what’s the point in over engineering and thinking too far ahead of success? I would rather focus on my data structures and their flows. I know if I scr…
A larger codebase than solves the same problem as a shorter codebase is almost always worse, has more bugs, and is harder to maintain. Code is the enemy: the only good line of code is the line that doesn't exist.
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#78A well-maintained, well-pruned test suite.
Writing tests forces you to clarify -- to yourself and to others -- precisely what this piece of software is and is not going to handle.
Re: Ask HN: How to avoid over-engineering software design for future use cases?
#79Invest in very good testing, especially higher level integration / system testing.
Invest in a good dev/staging setup for your production environment, and also try to make rollouts and rollbacks automated and as painless as possible.
There will always be the need to change stuff, so get the pieces in place to make changes easier code, easier to test, easier to deploy, and easier to back the fuck up when you inevitably cause something to burn.