5 ms·
A lot of complexity is defensive, that comes from limited information on how the code will run. For example if you’re asked to write a server with a public han
by wruza 2y ago
A lot of complexity is defensive, that comes from limited information on how the code will run.
For example if you’re asked to write a server with a public handler with an access to an important db, you may think of rate limiting it immediately.
Or if you have to compare two slices of a numeric stream to find out which numbers are “new”, you’ll spend half a day adapting and testing a complex dynamic programming routine, cause you don’t know if O(n^3)-ing it is fine cause n never exceeds 10 irl.
Programmers receive understated tasks all the time. Simplest solutions tend to fail and create Friday night recovery, so they learn to foresee the obvious and forecomplicate things to turn Friday nights into Friday evenings.
You don’t know what to take away. You may not even be sure how you will use your own system yourself.
- keepamovin 2y agoThat's an interesting take! Complexity is necessary defensiveness. Exactly - a lot of it can be that. Like well-designed complexity. Complexity because of the model. Whereas maybe we can say 'bad complexity' is complexity in spite of the model. I guess this is exacerbated in waterfall type designs or processes without iterative feedback loops. I like to code with tight loops to know the behavior and adapt.