Reading 17: Callbacks and Graphical User Interfaces
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
- Reading 18: Message-Passing and Networkingweb.mit.edu
- 6.4500 Design for the Web: Languages and User Interfacesdesignftw.mit.edu
- Reading 15: Promisesweb.mit.edu
- Reading 16: Mutual Exclusionweb.mit.edu
- Tutorial: Tic-Tac-Toe – Reactreactjs.org
- The Event Loop and Callback Hell - Wes Boswesbos.com
- Cơ chế hoạt động của javascript và nodejsblog.daovanhung.com
- Magic Ink: Information Software and the Graphical Interfaceworrydream.com
- Microtasks and event looptr.javascript.info
- Magic Ink: Information Software and the Graphical Interfaceworrydream.com
- Introduction to events - Learn web development | MDNdeveloper.mozilla.org
- You Might Not Need an Effect – Reactreact.dev