Hacker News new | ask | show | jobs
by ken 2621 days ago
> When someone says HTML & CSS is terrible I ask them to design something better that lets you represent user interfaces that can adapt across multiple screen sizes, and allow complex layouts that Flexbox and CSS Grid makes possible. It is easy to criticize something if you don't have to worry how you would do it better.

How about Cassowary, with size classes?

I spend half my programming time working on Mac software and half on web software, and I find element layout in the former is infinitely more pleasant. No need to put elements in a specific place in the document structure to lay them out the way I want. No need to change how I'm working for vertical versus horizontal layout. Just pick the dimension/coordinate you want to set, pick the other dimension/coordinate you want it to maintain its proportion to, and you're done.

Apple's implementation got a bad rap, I believe, because the first version of Xcode didn't support it well, the first version of the API was a terrible fit for Swift (which came a couple years after it), and pre-Sierra macOS had a lot of bugs in the implementation. Today, there's no layout system I'd rather use.

1 comments

Agree that it comes down to CSS (Box Model + Flex + Grid) vs Cassowary. I've never used it myself, so thanks for chiming in.

My understanding of it mostly comes from this thread (https://news.ycombinator.com/item?id=13125093) where the ReactNative team first attempted using Cassowary as their layout engine, but deemed it too complex/verbose and decided to use a subset of CSS. But as someone with actual comparative experience with both, would appreciate if you can tell me your thoughts on their conclusions.