Skip to content

Instantly share code, notes, and snippets.

@raineorshine
Created March 29, 2014 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raineorshine/9863223 to your computer and use it in GitHub Desktop.
Save raineorshine/9863223 to your computer and use it in GitHub Desktop.
why programming with callbacks is hard (jcoglan)

"null values returned by callback-based functions are the root of why programming with callbacks is hard: callback-based functions do not return anything, and so are hard to compose. A function with no return value is executed only for its side effects – a function with no return value or side effects is simply a black hole. So programming with callbacks is inherently imperative, it is about sequencing the execution of side-effect-heavy procedures rather than mapping input to output by function application. It is about manual orchestration of control flow rather than solving problems through value relationships. It is this that makes writing correct concurrent programs difficult."

https://blog.jcoglan.com/2013/03/30/callbacks-are-imperative-promises-are-functional-nodes-biggest-missed-opportunity/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment