by switchbak · 3y ago · 0 comments
I look at this stuff, and just think how sad it is that we haven't progressed beyond the state of gluing together freakin low level divs and spans within some JS code with callbacks galore.
For some reason I thought we'd have made it beyond that by 2023, and we could talk declaratively at a high level about the kinds of interfaces we want to render and where the data lives. Hopefully I'm wrong and the magic is buried under some Elm tree or a React library or something.
Something something get off my lawn...
Even in the old desktop world someone had to build the button widget (and all the others) that let you just throw stuff together in MFC or Swing or whatever.
Same today - someone has to build the web components in order for us to declaratively use them as high-level Lego.
Trouble is, there is no real high-level "general purpose" library of components beyond the core HTML elements (they'll get you a long way but there are notable things missing that we expect from apps, e.g. toolbars, menus, tab strips etc), and then the probably reason for their not being a general high-level library is that everyone wants something special for their websites (because historically websites have always allowed a lot of design flexibility, way more than your typical win32 app ever did for example).
I have several times really wished to have some solid "desktop style" components to use for things like menus, tool bars etc. That would make prototypes in electron/neutralino/tauri way way way faster to do.
This is why I hate making web UIs.
> then the probably reason for their not being a general high-level library is that everyone wants something special for their websites
This is why I hate using web UIs.
At this point it's hard not see this as a fully self-inflicted wound by the platform. I know there are component libraries, but the work always remains fragmented because someone decided that their buttons needed purple highlights while someone else's needed drop shadows.
And the devs seem to love staying at this low level of abstraction. Feels like they had to be dragged into the component model espoused by React et al over many years.
The biggest difference between other major platforms and the web, is that the web doesn't come with a default UI framework. The primitives for building UI on the web are pretty good though.
I do think the web is a lot easier to learn and the on-ramp is so much faster compared to older mobile UI frameworks, so it makes sense that they're sort of evolving toward the same patterns.
Building a declarative UI that compiles to that sort of declaration means building that from scratch. We do currently work like that though. React isn't that far and web components built into an element of that.
I think that's why frameworks like Tailwind etc. have got so popular -- they're much closer to the traditional native application way of styling. You set all the appearance details on the component and then you reuse the component, styles and all.
<Card>
<Avatar />
</Card>
This is talking declaratively at a high level about the kind of interface to render. Lots of component frameworks look like this example. Thinking "how sad it is that we haven't progressed beyond the state of gluing together low level divs and spans" sounds like a preconceived idea rather than a response to this article.By the way, I come from mid-80's BASIC on 8-bit home computers. You get off my lawn.
As a random example, HTML specifies that clicking a `<button>` inside a `<form>` automatically submits a POST request to the current URL. We can't change that because it will break a lot of webpages that rely on this default behavior, so now every component system built on top of <form> or <button> needs to prevent the default browser behavior, and there are so many more examples of things like this.
I’m not saying that old GUI component frameworks are vastly superior either. I just imagined that we’d have progressed well past the kind of approach the article is mentioning.
It’s a side rant, but I don’t think it’s entirely without merit.
Sadly elm hasn't really taken off but as far as frontend goes... it is just so simple together with elm-ui.
In my opinion, the community is lacking foundations, structure, and principles - something that would otherwise be instilled by formal education. JS is fantastic for exploring how programming works, it makes it easy to stitch things together, and the barrier to entry is basically zero; all you need is a text editor and a browser.
The flipside is that people regularly reinvent things, same sets of ideas get formed and re-formed, fall into and out of vogue over and over again. It is true that there is great complexity to be dealt with in this domain, but it feels like whenever the current set of tools and practices matures enough to face some of the hard problems, the instinct in the community is to "start from scratch" and before long some new shiny exciting thing appears. It shows a lot of potential, it's nowhere near facing the hard problems, people jump on the bandwagon, time passes, and the new set of tools and practices arrives at precisely the same place.
Web components have been in the works for a long, long time. The inherent competition between the major frameworks divides people into camps, which doesn't help. But, seeing the slow but steady progress in the web components realm indicates to me that they're apart from the patterns I was ragging on in the previous paragraph. They increasingly seem to deliver on the promise of creating advanced building blocks - perhaps one day a developer won't have to choose between a React Table, a Vue Table, a Gobagool Table, etc, but use a plain vanilla standard issue web component table to display their CSVs.
Most other GUI libraries is in a much worse state than front end web dev. That is probably also the reason why people use front end tech to make native apps today, because you can customize and make apps much faster than in basically any other way.
I think front end gui development is very easy today and very powerful as well and we have progressed a lot. Making stuff with web components isn't event that hard and if you want you can just use one of the many available syntax sugar libraries that exist like Lit and others.
INTERCAL could win with that feature set.
> why people use front end tech to make native apps today
Even when you have to deal with IT security losers to get apps installed, implementing it w/ web tech is extremely popular.
E.g. the #1 IDE by popularity [1] is a desktop app developed with web tech. (And yes, it was later ported to browsers, but it didn't start there.)
[1] https://survey.stackoverflow.co/2022#section-most-popular-te...
I'm certainly not going to suggest you're wrong. But I would like a sincere comparison between JavaFX (because I sorta know it) and "the web".
Maybe its unfair, since the Web is "just the DOM", an empty vessel many of the other techs are built upon, which is why there's so many options.
I'm not a front end person, by any means, and have been striving to make things work with FX. I mostly "get" FX, how it does things with its containers and layouts and properties and bindings and events and UI thread. It has CSS, I mostly don't use it (better living through gray!).
The web, honestly, intimidates me. It intimidates me with its vast variety, its complex build processes, the apparently galaxy of dependencies and tools and what not. Cross browser stuff terrifies me. And maybe that's the wrong reality, but that's the impression I get.
I'm managing to Forest Gump my way through FX, but I have a Java background.
The web feels downright cohesive, stable and well documented in comparison.
Why publish with restrictions when you can be free?
A simple example of this is most backend frameworks let you signal an error by throwing an exception. Good choice! Except when you go to throw one, you often have to choose from a bunch of HTTP status codes to bundle with your exception. I want to tell the user that validation failed, that's all. I should throw a ValidationError, not a HttpResponseError. They're not really abstracting anything, just adding a layer of structure, usually via libraries that are glued together.
Similarly, I've started to be of the opinion that the ideal HTTP request handler has very few HTTP-specific details in it, as the framework can introspect the types and annotations to determine how to pass data in and out. This is very different from typical frameworks which are happy to hand you raw requests and responses and tell you to do it all. Nothing wrong with that for special cases, BTW, except for people's tendency to mix HTTP, infrastructure (DB/messaging/APIs), and business logic in the same handler.
There will always be cases where you need direct control, but I've been moving towards stacks that automate most of this to cut down on the gunky makework feeling I get when doing webdev, and it has been integral to me actually enjoying the tooling rather than feeling like I'm filling out TPS reports. Currently that's Spring Boot + Kotlin, despite the enterprise stigma the JVM and Spring have.
While I agree, this is what we're stuck with. I have 25+ years of experience. Before JavaScript and CSS existed.
Now? I'm on an Angular 16 (moving to 17 SPA).
Worked with almost everything else in between.
I had all the same feelings. "We're doing what with JavaScript now??".
It turns out, it's not all that bad. TypeScript is pleasant enough, for me Angular is logical, and sure at the end of the day it's all just HTML/JS/CSS but what can you do?
We're stuck with it, unless WASM totally up-ends the entire thing and we have JIT'd languages like .Net and Java running on the client ... which is ...
Well, I'm not even sure what that is anymore. It's not HTML, JS, and CSS!
And yet it's so easy and forgiving that millions of 13 year olds learned it for their myspace and tumblr pages over the last 15 or so years.
Somehow, despite all the CS graduates and 20 year software engineering veterans bemoaning it, more and more people learn HTML, CSS, and Javascript every day while the number of people learning native GUI development struggles to keep up or outright fades away. I truly believe that most software engineers don't understand what ergonomic software or programming languages look like. They're blinded by their expertise
Maybe part of the problem is that the web is the only platform where people obsess over the size of deployed artefacts. Websites are certainly getting bigger, but they’re still an order of magnitude smaller than the average snap package or iOS app.
(^ feel free to copy-paste that to any HN thread)