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.
Or read this on Hacker News