Easily Impossible: One approach to designing a great API
▻https://hackernoon.com/easily-impossible-one-approach-to-designing-a-great-api-16fc02e42d?sourc
Why building graphical user interfaces is hard.Why is it so hard to write and maintain UI code? One of the reasons is poor API design. Specifically poor balance of control vs effort over a set of use cases. Effort is the time it takes to implement a use case using an API. Control is how fine-grained the commands that we send to an API can be.This issue of balance is not GUI-specific, it’s a generic problem in API design. This post is my attempt to understand the dynamics between control and effort using examples from #frontend development.The lost art of geometryHere’s a puzzle. Let’s say we have two rectangles. One is taller and wider than the other. We want to place and vertically center the smaller rectangle inside the larger one.The height of the larger rectangle is h1. The height of the (...)