Comment by PaulHoule
2 years ago
What's the alternative?
The 1990s style HTML form app that works like a green screen mainframe application? (It seems to be forgotten technology in the age of React like Stonehenge or the Egyptian Pyramids but I think it's quite appropriate for the kind of application it's capable of, which is more > 50% of what people use React for.)
Cross-platform frameworks like GTK, Qt, Tk, FLTK, wxWidgets (was that a winner in the world cup for "ugliest UI"?), Flutter, etc. (I did a shootout of x-platform UI frameworks and concluded that Electron really is the best of the bunch, is it any worse to make people download a 30MB Electron runtime than a 50MB Java runtime or a 25MB Python runtime?)
Apple fanboys inexplicably seem to like iTunes and MacOS, they all swear by xCode but even people who think "it is is all good" when it comes to fruit swear at the App Store when it comes to delays and restrictions. I'm pretty sure there is a good UI framework somewhere inside Windows but it might be hard to find in a maze of twisty little APIs that all look alike:
https://www.reillywood.com/blog/windows-ui-frameworks/
Compare that to the freedom of the web platform. I've lately been playing around with this framework with my Meta Quest 3:
https://aframe.io/examples/showcase/modelviewer/
which makes it straightforward to make an application that targets desktop, mobile, VR and AR headsets. Although it is based on React it has the same entity-component architecture as the Unity framework. I'm sure I could get better performance writing a more-or-less Android app based on Unity but dealing with Facebook's App Store seems like messing around with IBM cards, particularly when I want to target Apple Vision when it comes out and when I need to have an experience for people that don't have a VR headset because those aren't very common yet.
One of these days I'll actually try writing a React-style (well, really Wicket-style) UI framework where styling is always inline - no cascades, no stylesheets, no selectors, just style attributes. If you want to reuse styling, you do it the same way as reusing markup, by having libraries of components.
With transparent compression it shouldn't make pages any bigger on the wire, and given that the browser always has to figure out what styling to apply to each element it shouldn't use any more memory.
> What's the alternative?
Good question! What do you mean? There is no alternative, just enough experience writing it that these mistakes become hardwired, or having browsers updated to interpret "no-wrap" as "nowrap" for ex.
The options you mention make sense, but just a level of abstraction. CSS is still the compile target (unless you're using WASM etc).
Unless you mean alternatives to, say, using things like `!important`?
[dead]