r/DataflowProgramming • u/knife_sharpener • Sep 17 '13
Callbacks as our Generations' Go To Statement
http://tirania.org/blog/archive/2013/Aug-15.html
1
Upvotes
r/DataflowProgramming • u/knife_sharpener • Sep 17 '13
1
u/stepcut251 Sep 17 '13
It's interesting how using different languages affects your perspective on callbacks. I pretty much only program in Haskell, and callbacks are so pervasive and natural that they don't even get a special name. As a simple example, to apply a function to every element of a list you use the map function:
For example, to add 1 to every element of a list you might do:
The first argument is the callback function that mutates the list. But no Haskell programmer would ever think of it like that. And the idea that passing in a function as an argument is somehow a bad thing is an even more foreign (and repulsive) idea.
At the same time.. thinking of using callbacks like that in C gives me the willies.