5 ms·
Actually I still find continuations hard to grasp. I still have to stop and think before writing code involving continuations, the same way I have to stop and
by pg 19y ago
Actually I still find continuations hard to grasp. I still have to stop and think before writing code involving continuations, the same way I have to stop and think before driving from A to B in Cambridge.
It doesn't feel like continuations match the way the mind works. Ditto for nested backquotes, though I've never been able to think of a better way to do what they do.
- ericb 19y agoI was mainly thinking of difficulty understanding as opposed to difficulty doing. Our minds aren't impressive short term memory-wise. That might be part of the nested backquotes problem. Memory prodigies usually don't have greater short term memories--they're just better at "chunking" which is really a compression strategy. Cambridge roads are Escheresque. I've been to Manhattan a few times, but my mental map of Manhattan is better than of Boston, where I live. You gave a talk about compression and beauty, if I remember correctly. Maybe it's all related--beautiful things are more memorable.
- sah 19y agoI agree with ericb that many apparently difficult concepts are made harder to understand by an abundance of poor explanations. But in the same way, some of them are made harder to understand by poor design. Continuations might be an inconvenient factorization of their underlying concepts. Monads seem more fundamental to me, in that they capture a broader class of ideas, and seem less machine-oriented. But the overwhelming number of awful monad tutorial blog posts suggests that they aren't any more convenient to think about than continuations. I think maybe we're lacking a good framework for thinking about concurrency in general. Threads seem simple at first, but make it easy for even very skilled hackers to get tangled up in race conditions and deadlocks. Coroutines are perhaps easier to grasp than continuations, and easier to reason about than threads, but seem less fundamental.