3 ms·
Very good example of how even a small scale piece of logic can have very messy effects down the line. Both insufficient and wrong abstractions are viral. They
by dgb23 3y ago
Very good example of how even a small scale piece of logic can have very messy effects down the line.
Both insufficient and wrong abstractions are viral. They infect everything they touch, which can snowball into large parts being more complex, harder to understand and debug and often also slower.
The wrong abstraction is wrong, insufficient abstraction is wrong.
Really the only weapons against complexity we have as programmers are decomposition and abstraction. We have to take things apart, like in your example it would be the meaning of each parameter, and then we put them together in such away that the details below our abstraction can mostly be ignored.
I say that all with a caveat: I tend to prefer less, insufficient or no abstraction over the wrong one. The former few options can lead to code that is hard to understand as a whole and can be brittle, but the latter drives you into a corner: The only way out is either trying to patch over it or starting from scratch - choose your poison...
- marcosdumay 3y ago> the latter drives you into a corner: The only way out is either trying to patch over it or starting from scratch Often enough, the way out is going back. Why are developers collectively so reluctant to go back? (Myself included.)
- dgb23 3y agoGoing back not only means starting from scratch but also adopting anything that the code to be changed touches. It's often a lot of work with uncertainty and thanklessness attached to it.
- marcosdumay 3y agoNot starting from scratch. But developers never do things like reduplication, or merging modules. Those concepts are so alien that I believe if I say those words on a recent conversation, lots of people will pop trying insisting on redefining them into meaningless ones.
- pkolaczk 3y agoIt's not any worse than introducing a new abstraction when there previously wasn't one. At least in a statically typed language one will quickly identify those touch points. When introducing a new abstraction there is no such help.