Get the latest tech news

Library patterns: Why frameworks are evil


This article continues my mini-series on functional library design. Previously, I discussed why your library should provide multiple levels of abstraction. Today, we look at composability and avoiding callbacks. These two often go together - frameworks are based on callbacks and are not composable, while good libraries avoid callbacks and compose well.

Previously, I wrote how multiple layers of abstraction let you build libraries that make 80% of scenarios easy while still supporting the more interesting use cases. The following first initializes the resources and the Game object and then it implements a loop (using recursive async blocks) that waits for either Update or Draw event using the AwaitObservable method: This is in contrast with building a fragile scaffolding on top of a poorly designed library that is sometimes needed if you want to write elegant code.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of library

library

Photo of frameworks

frameworks

Related news:

News photo

Microsoft's Windows 95 startup sound has been immortalized in the Library of Congress

News photo

The sound of Windows 95 about to disappoint you added to Library of Congress significant sound archive

News photo

Onyx Boox Page v4.0 keeps the e-reader fresh with Library and file updates