[racket] John Carmack on why functional programming matters
And how to do it in C++:
gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php
He's not saying anything PLT hasn't been saying for years. But he does
say some of them differently. And he's John FRIGGIN' Carmack: the guy
behind the first 3D games ever made, and a current game industry
mover-and-shaker and icon. He has a chance to reach people we can't.
I copied some great quotes while I read this. Starting with the one I'm
most sad to agree with:
"... it would be irresponsible to exhort everyone to abandon their C++
compilers and start coding in Lisp, Haskell, or, to be blunt, any other
fringe language."
It's for external reasons, like reliance on proprietary libraries and
tool chains, and certification requirements.
This one should be framed somewhere, for the second sentence:
"A large fraction of the flaws in software development are due to
programmers not fully understanding all the possible states their code
may execute in. In a multithreaded environment, the lack of
understanding and the resulting problems are greatly amplified, almost
to the point of panic if you are paying attention."
He explains Racket's pragmatic purity rather well:
"It can be fun in a puzzly sort of way to try to push purity to great
lengths..."
"There is a continuum of value in how pure a function is, and the value
step from almost-pure to completely-pure is smaller than that from
spaghetti-state to mostly-pure."
Neil ⊥