flâneur — a map of the web's best reading

Reading 17: Callbacks and Graphical User Interfaces

web.mit.edu · 6,276 words · saved by 1 readers

In this reading we talk about callbacks, in which an implementer calls a function provided by the client. We discuss this idea in the context of graphical user interfaces (GUIs), where a kind of callback function called a listener is used to respond to incoming input events from the user. We briefly saw callbacks when discussing asynchronous computation in a previous reading, and we’ll see more instances of callbacks in future classes, when we talk about web servers. A callback is a function that a client provides to a module for the module to call. This is in contrast to normal control flow, in which the client is doing all the calling: calling down into functions that the module provides. With a callback, the client is providing a piece of code for the implementer to call. We already saw one kind of callback in Functional Programming: the function passed to map or filter or reduce, which is called repeatedly for each element of the sequence. This is a synchronous callback, because it

Reading 17: Callbacks and Graphical User Interfaces Reading 17: Callbacks and Graphical User Interfaces Software in 6.102 Safe from bugs Easy to understand Ready for change Correct today and correct in the unknown future. Communicating clearly with future programmers, including future you. Designed to accommodate change without rewriting. Objectives In this reading we talk about callbacks , in which an implementer calls a function provided by the client. We discuss this idea in the context of graphical user interfaces (GUIs), where a kind of callback function called a listener is used to respo

Explore this link on the map →

saved by

related reading