▲ | vbezhenar 3 days ago | |
> We can avoid stack overflow by avoiding unbounded recursion. Only if you control the entire ecosystem, from application to every library you're ever going to use. And will not work for library code anyway. > In user-space, memory overcommit means that we will almost or literally never see an out of memory error. Have you ever deployed an application to production? Where it runs in the container, with memory limits. Or just good old ulimit. Or any language with VM or GC which provides explicit knobs to limit heap size (and these knobs are actually used by deployers). > This is a terrible argument for treating all code as potentially failing with any possible error condition. This is reality. Some programs can ignore it, hand-waving possibilities out, expecting that it won't happen and it's not your problem. That's one approach, I guess. | ||
▲ | frumplestlatz 3 days ago | parent [-] | |
> Only if you control the entire ecosystem, from application to every library you're ever going to use. And will not work for library code anyway. Two edge cases existing is a terrible argument for creating a world in which any possible edge case must also be accounted for. >> This is a terrible argument for treating all code as potentially failing with any possible error condition. > This is reality. Some programs can ignore it, hand-waving possibilities out, expecting that it won't happen and it's not your problem. That's one approach, I guess. No, it’s not reality. It’s the mess you create when you work in languages with untyped exception handling and with people that insist on writing code the way you suggest. |