“To be safe allocate 5 bytes more than you need”
I was going to trash this, but it actually made me think of something non-obvious: where is the line between hacks like this and smart behavior? For example, we have code in systems that performs network retries, and I have code in my own software that performs polling operations when a request&#x2F;response &quot;should&quot; work, but in practice, a variety of reasons cause it to be less robust. It seems right that something like &quot;allocating extra memory just to be safe&quot; falls on the wrong side of defensive programming vs obvious kludge, but where is the line, exactly? It doesn&#x27;t seem to be first vs third party code. Is it network hops? That seems extremely arbitrary, especially given that modern networking has characteristics closer to a bus than say, accessing a disk, where such defensiveness is less sane. If network boundaries are the norm where we start assuming failure is likely, maybe that&#x27;s why microservices are considered beneficial since they result in more defensive programming in practice even though in principle there&#x27;s no reason that needs to be the boundary? Maybe I&#x27;ve had too much coffee this morning.