Re:Purely Functional Data Structure by Chris Okasaki [pdf]
by 1MachineElf on Tuesday May 30, 2023 @10:52AM
(#36125565)
I wanted to verify the book reference, and I think you could be correct.
There is a website for it: https://writingsolidcode.com/
The Amazon page it links to includes a few Index pages in the preview. I saw these under E:
Excel number formatting code 163
Excel's dialog handling code 113
I think there is real value in starting with the pure functional versions, then swapping out when needed. One problem that seems fairly common in large codebases is using an object as a hash key. but as the code grows, that object sort of gets passed around and eventually somebody updates it without rehashing. That's a tough bug find. They are for me anyway.
This is one of those rare cases where you can actually make it faster later without trashing the overall design.
I'd encourage starting with the pure functional version first, every time. I'd go further and say, leave some opportunity to flip back to the pure functional version in dev builds for isolating heisenbugs.
Blah blah, grain of salt, free advice, your milage may vary, Games have different requirements than webpages, everything is contextual.
This is one rare case where it's always worth having the capability of swapping back and forth is worth it. Just use it, and think hard before giving it up is a really good default.