3 ms·
Lazy is a win for two reasons. The article talks about the first win: the code can skip evaluating items that are never reached. The more important win IMHO is
by jph 11y ago
Lazy is a win for two reasons. The article talks about the first win: the code can skip evaluating items that are never reached. The more important win IMHO is in time-important areas such as UI/UX and heuristics.
For example with UI/UX and lazy loading, you can use lazy initialization to get your UI/UX on the screen faster for the user, by deferring a bunch of content initialization to after the UI/UX.
For example with heuristics and lazy calculations, you can use techniques such as successive approximations, caching of recent similar results, eventual consistency, and partial filling, so you can provide decent information to the user.
- braythwayt 11y agoI first used lazy sequences in Scheme for a similar purpose, to find successive approximations. I recall lazy sequences like 0, 1, .5, .25, .75, ... and diagonalizations for these purposes.
- techbio 11y agoCan cause problems while appearing to satisfy the desire for responsiveness. For example, on the iPhone: recent messages or calls may update in the middle of a touch, so the location of the input (thumb) actually initiates a call or brings up a thread not intended by the original display. Showing what had been, and then updating the action of a display location, creates a UX of "shifting sands". Often annoyingly occurs with popup ads, but in an iOS app itself is inexcusable.