4 ms·
I think that the way we build user interfaces today on the Web is fundamentally flawed. One need to learn JavaScript/TypeScript, then HTML and DOM, then CSS. Th
by giamma 3y ago
I think that the way we build user interfaces today on the Web is fundamentally flawed. One need to learn JavaScript/TypeScript, then HTML and DOM, then CSS. Then most likely you need to learn Angular or React or Vue or whatever, some widget toolkit like Bootstrap, get accustomed with Webpack, minification, uglification, rely on countless MIT-licensed libraries whose authors may come and go because the base runtime (=the browser) just gives you DOM, CSS and plain JavaScript.
Did you ever tried implementing a desktop UI using an object-oriented multi-platform toolkit like SWT or QT or GTK? There are good chances that all the dependencies you will need are already "there", you learn the widget toolkit bindings for your preferred programming language and you can start. It's so much more productive and fun (at least for me) and most of the time you don't need to mess up with colors, styles etc. etc. because you will want the operating system to take care of that.
On the Web you have so much more freedom, because the web page is almost a canvas, but at the same time (for me at least) it looks way less productive and everytime I think of it, I always wonder why nobody is proposing anything better for the Web and the industry keeps on building layers of complexity on top of JavaScript/DOM/CSS.
- cxr 3y ago> Then most likely you need to learn Angular or React or [...] For a very loose definition of "need". > Did you ever tried implementing a desktop UI using an object-oriented multi-platform toolkit like SWT or QT or GTK? There's an abundance of desktop application code written in JS from the GTK+ folks themselves. They embraced SpiderMonkey (the Mozilla JS engine) years ago and have been shipping stuff on it for just as long. Anyone who has booted into the default desktop on Ubuntu—or any other installation running Gnome—has already come in contact with it, perhaps even today. That doesn't get a lot of attention, though, because it's not "squeaky": it isn't plagued by the same problems that people (stupidly) associate with "JavaScript" despite the fact that what they're really thinking of are problems with the NodeJS/NPM community in particular and its spectacular tooling + other webdev-oriented accomplishments. I.e., all the things it insists are requirements for the Modern Programmer—a mission which their detractors assist them on by perpetuating the story themselves (cf "need")...
- giamma 3y agoI am not familiar with JS in GTK+, but if it's a JS binding for GTK+ it's exactly what I meant when I said that on the desktop you can implement a user interface using your preferred language as long as bindings exist for a decent widget toolkit. And it sounds totally legit to me. If instead what you are referring to is something similar to Electron, that is something I "hate"; I understand it's a cheap way for a Web Developer to reuse the skills and build a desktop application, but the result is typically buggy, bloated, slow, and does not integrate properly with the desktop environment (fonts, colors, clipboard, accessibility are just the first things that come mind).
- cxr 3y agoI'm responding to your thread—the one where in response to your suggestion that it would be a good thing if it were possible to prevent "this" (presumably the introduction of JS in 1995, the topic of the submission), the person replying to you wrote, "I know it's the fashion on HN to hate Javascript[...] It's not Javascript's fault the language was ruined by SV and survellance capitalism." The things you're complaining about are not a JavaScript problem. They're a programmers-who-have-their-feet-firmly-planted-in-the-world-of-NPM-and-modern-webdev-tooling problem. > something similar to Electron[...] is something I "hate" Wait till you find out how Firefox itself (i.e. the UI and other application logic) is implemented: "DOM, CSS and plain JavaScript". Mozilla was doing Electron-style apps before Electron ever existed. Somehow it's a higher quality app than the sorts of things you had in mind when you brought up Electron. Again: that's because it's not a JavaScript problem.
- giamma 3y agoSure, I am not against JavaScript per se (although my preference goes to strongly typed languages), my first comment had a smiley at the end, I just firmly believe that the way we build UI for the Web today is flawed.
- cxr 3y agoSo don't build them that way. You could do worse than ignoring every piece of advice that is considered best practice in mainstream modern Web development.