3 ms·
>> When it's a pure function that's not a problem. That was my point. He's conflating two different things. I understand why inlining mutation has benefits. Ju
by apeace 10y ago
>> When it's a pure function that's not a problem.
That was my point. He's conflating two different things. I understand why inlining mutation has benefits. Just not inlining functional code.
>> And of course, almost all interesting software has mutable state.
Of course, but I think most programmers overestimate how prevalent state needs to be throughout a program.
I once wrote an RSS aggregator as an eight-stage pipeline. It checked about 40k feeds, each every 60 seconds. Every stage had a 'main' file where the vast majority of state was kept. The rest was functional libraries. I suppose that would be a demonstration of what Carmack is proposing, with the difference being that my pure functions (the majority of the code) had clear names and were unit-tested.
It worked so well that almost every large program I've written since has been designed the same way!