by strogonoff · 1y ago · 0 comments
If it was a result of a single very well thought through vision and developers were expected to be committed to conforming to the latest API (think Apple’s iOS runtime or the like), we could maybe expect the <thread> and <comment> tags, we could demand there to be The One Correct Way of doing anything, that the “fat” is trimmed quickly and features go from deprecated to gone in a year. However, it is a product designed by committee (in fact, by multitudes of various committees) that has largely maintained backwards compatibility for decades, it is a free runtime that grew organically from what was supposed to be a basic hyperlinked document layout engine but now powers fully dynamic applications rivaling their native equivalents yet still has a pretty low barrier to entry for new developers, and as such it’s remarkably robust.
Yes, some applications tend to have a large amount of markup for what seems like simple features (the Slack’s input box example). However, the alternative is that browser vendors bake it all in, and then every app is stuck with the opinionated way they think is right. Perhaps some amount of chaos is healthy.
We have <!doctype html> but why not add other doc types as time goes on? Instead of shoehorning features you could have a <!doctype new-html> which would opt a web page into the ability to use newer features like newer elements or cleaner APIs
There is also the “use strict” directive in JS (which any script tag with type=“module” runs in now, slowly eliminating this need) that would opt your script into a stricter form of JS. You could even do it on a per function basis. We could have something like that for other features or stricter qualifiers etc.
We have done this before successfully and broadly, I think it’s time we revisit the usefulness of doing this again
We do have older ones!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
and <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Unfortunately the "be liberal in what you accept" principle, in combination with general incompetence and anti-competitive practices by certain browser vendors, meant that all the browsers kind of ignored it and treated everything as quasi-structured tag soup regardless of the doctype, which is why WHATWG tried to codify what the browsers were already doing and decided we should all just <!doctype html>.Have we collectively learned the lesson? If so maybe we could have a new doctype for [X]HTML 6. I won't be holding my breath for it.
Javascript has "use strict" to disable the parts that fundamentally cause problems even if you don't use them.
What exactly is in html you want to disable here? There are features that maybe dont make sense but they are largely self-contained. Unlike in js you can simply not use them and its fine.
The web platform has just done exceedingly fantastically well with incredibly respectable people working really hard to steer things forwards. Having multiple layers of security and technical architecture groups to review, having other browsers review proposals: it's inconceivable to me to imagine spending 1/20th as much effort building an alternative of any even modest caliber. They sure tried with Dart, Flutter, Fuschia, but it's just not a significant enough lift, it's just another app dev platform, and it's desire for pixel perfect graphics made it absolutely ass and terrible at being a good reactive malleable platform. And it being Flash 2.0 made it vastly inferior to what users got from the web.
The web is big and dense. Even ignoring the sprawling amazing magical web platform and focusing on the robust DOM. And that pisses a lot of people off. There is much clutching for certainty, wanting to be steered. Devs crave having the validation of Modernism, of solutions that when written fit expected shape and parameters. 'Another fine Cathedral!'; you know it when you see it. But the web doesn't give us that certainty at all. There's many ways to get there, there's overlapping options and tools, dozens of paradigms to pick from for how you want to organize your css rules, different layout models to swizzle together. The dirty rough open possibility of the web Bazaar drives people frelling off the wall.
I can't help but see those people clutching for certainty as hopelessly out of touch with the universe, obsessed with a narrow engineering paradigm of control & missing the organic beauty of life the universe & everything. Wittens here at least has some core points (amid lots of buckshot, much that various tensions are unresolved).
It's fantastic that we have so many different ways to do web apps. The basics have proven so malleable, such endless ability to be interpreted and governed into forms of whatever we might imagine. The layout of the DOM has gotten so so much better, had so many wonderful additions and fixed in the past decade. The Web Platform Tests have put to the sword so much uncertainty, become a massive way for the web to remain one thing even across many browsers. New browsers like Ladybird and Servo show promise of new engines, new life. Web Components will or won't they questions dog us us still, we all consult our team leaves to guess their future, but meanwhile a similar structuring of custom comments is endemic to React. Invoker/commands are spreading id-ref dogma, for the page linking to other parts of the page declaratively. It's all incredibly exciting. I'd be very happy to have anything else that shows life, that can compete as an equally radiant open question we can continue to improve. But that's not what the DOM haters are after. And the narrow vision view: I think it bereft & sad, and the lack of material they have to point to to steer us, to offer spiritual council upwards rather than just condemning downwards, throwing faint "bloat" condemnations: it makes me sad we critics so obviously up to no good, who just standby and have such vacuous aspersions to cast, on endless repeat.
We already have similar sofware development patterns, but I wonder what a Web API surface would look like when fully embracing a similar modular mindset.
Pretty easy, we should have had 2 standards, one being "Web for applications", built on a VM, stdlib, bytecode, RPC, UI framework and standard library of controls, ... And "Web for web pages" which was a solved problem pre-HTML5 days.
Java and Flash (although very problematic from a security point of view) were probably better bases on which to build "Web for applications" than HTML5+/CSS3+/JS/WASM will ever be, but it was intolerable for Google/Microsoft/Mozilla to hand the keys to Oracle/Adobe for that. It's all politics, and it's all worse and more complicated and more inefficient as a result.
I’m sure the person you were referring to doesn’t want to make the web shit for the blind. Calm down
That's essentially where the web was at before the HTML5 days: you could already go as fancy as you wanted, at the cost of pushing your users into a java/flash applet (and through longer loading times, high CPU/Memory requirements, …), and that clearly wasn't the norm.
Contrary to what was stated in the suggestion, it’s hardly a solved problem—improvements are being made at a steady pace (grids or { text-wrap: pretty } come to mind)—but it is interesting to imagine, especially if there were extra compelling reasons for engineers to restrict themselves to purer hypertext document API if possible (for example, it could be much more stable, while the app part could be unlocked to evolve more quickly but would be more demanding to developers keeping their webapps up-to-date; search engines could prioritize it; there could be hosting services specializing in it; and so on).
One counter-argument is that you can’t neatly separate the two and engineers will definitely want to use both; one way around it I can see is if hypertext document functionality was possible to use from within the webapp somehow, but I haven’t given it that much thought obviously.
The browser is really just a cross-platform platform for building applications.
Was Java any worse from a security point of view than what we have now?
The DOM cannot assume that it's just for building declarative applications, it needs to support imperative functionality too... IMO, the custom Web Components API solves the declarative problem very neatly, much more neatly than React or any other declarative framework I've come across.
I think it's wonderful how the DOM API has evolved slowly over time to meet user needs and it would be foolish to think we can just redesign it better from the bottom up without sacrificing some gems.
I think the people complaining about it are stuck in some utopian mindset. They have a specific frame of mind and they look at the DOM through the lens of a limited number of use cases which are relevant to them. They hold rigid, blanket beliefs around concepts like "Functional programming, side effects, reactivity" but these beliefs are siloed around each concept; they neglect the fact that the intersection of multiple approaches can transform the problem and radically alter the equation... For example, the modularization of Web Components and associated lifecycle methods, greatly reduce the dangers of imperative programming within component boundaries.
It's good to be aware that both strong acids and strong alkaline solutions are dangerous on their own, but one should recognize that mixing them together could completely change this fact.
The browser should be doing most of the heavy lifting by providing a full suite of minimally themed but capable widgets that require little to no JavaScript and can be skinned entirely with CSS. That alone would wipe out an incredible amount of complexity and if done right would make web dev as an experience vastly more pleasant.
Well, I'd prefer if it provided widgets that can't be skinned. :-) The theming should be the user's choice, not the app designer's.
> That alone would wipe out an incredible amount of complexity and if done right would make web dev as an experience vastly more pleasant.
I don't really care so much about the web dev experience as the web user experience. My experience as a user is greatly degraded by a bunch of web devs full of bright ideas about how to make their apps look, rather than using predefined widgets whose look is determined by me.
> Much of this complexity comes down to primitives being too primitive for the use case of web apps.
I totally agree with this, although I disagree about what the better alternative is. In my view it is partly this issue that's led to the disappointing profusion of "skinning". In desktop app toolkits you use a tree view, or a button, or a dropdown, or whatever. That widget's "identity" is based around functionality and its look and feel are not controllable by you as the app author. Instead, they're determined by the user's platform (color/font settings, window manager, etc.). That's a better model for users.
Though I can see both sides, there is a belief system in which this type of work is best delegated to professionals.
Still, it's quite sad how long we had to wait for stylable checkboxes.
The problem is that there aren’t even really any attempts out there. The closest as you say are web components, but they’re still extremely primitive relative to something like AppKit or win32.
My guess is that would put the burden of keeping up with evolving APIs on web developers and web companies. And there is a huge and very diverse ecosystem out there.
Native app developers seem to be burning resources trying to stay in stores and working on modern devices.
I cry at the ways we are doing and defining column tables.
It already does literally that. Have you heard about <form>? These common widget libraries seldom last, and that's because people want to differentiate on style in ways that go beyond a CSS skin.
> people want to differentiate on style in ways that go beyond a CSS skin.
And the reason this is a problem is due to shortcomings in current widgets, which is part of what I was getting at. There’s no technical reason why everything can’t be skinned with CSS, as we’ve seen with modern versions of GTK+ which rely on it entirely for styling. It’s fixable, but there’s little work being done to actually fix it.
I believe that some sort of a constraints language would've been a lot better at describing page layout. And stuff like Web applications simply shouldn't exist. These should be applications that use native UI toolkits while relying on Internet for moving data, not presentation.
Users are usually unhappy with Web applications because of the way browsers restrict useful functionality and programmers struggle with workarounds and bloat of browsers to accomplish simple things.
I AM SOLD
HTML5 input and form validation are still a broken nightmare that can barely be patched by adding copious amounts of JavaScript.
Sometimes I prefer the raw simplicity of writing your own layout code. You then basically just need X/Y coordinates, anchor points and dimensions of the screen and the elements on them. The rest can be done using simple arithmetic. The good thing about this is that you can do 95% of what people use CSS for, while using a handful of consistent methods. Wbile this to the uninitiated requires some introduction into how to think in a coordinate system, the simplicity can be refreshing.
Meanwhile in CSS you have a organically grown complexity of features where sometimes things that should be simple are hard, often because the elements that should be styled have default attributes with subtle differences which people aren't aware of. Only the minority could tell you the differences between display: inline, block, inline-block, contents, flex, grid, table, rable-column-group, etc. But elements may have them set per default.
I get that it is hard to simplify CSS for reasons of backwards compatibility, but sometimes I wish that instead of adding on top someone had had a long hard think about how to solve the problems elegantly and with consistency instead.
Or, you know, provide a set of usable controls that provide useful functionality out of the box and provide a set of useful APIs so that people can either extend those controls or create their own.
Web Platform provides neither. Compare that to literally every other UI toolkit under the sun. Turbo Vision from 1990s was a better toolkit than anything the web has to offer.
...hell, native apps are still more likely to be crap than not. Good UIs are hard and programmers are lazy; the big advantage of web apps remains the difficulty of an app completely crashing the browser due to sheer developer apathy.
I’m not at all a frontend person, I just think flex is one of the best systems I have ever used. It usually gets the job done in a way that I expected to work (and that bar is pretty low lol)
<table width="100%" height="100%">
<tr>
<td colspan="2" height="50"> header </td>
</tr>
<tr>
<td width="200" valign="top"> sidebar </td>
<td valign="middle"> content </td>
</tr>
</table>And ~15 years ago a consensus formed that making separate sites for phones and other devices was not the way forward and tables are ill suited for responsiveness.
We've had CSS Grid for 7-8 years and Flexbox for longer, tables can be left for what they're good at, tabular data, not layout.
Not really. The Web is owned and operated by Google. They can literally do whatever the fuck they want with it. (Any "standardization" process is less then a formality at this point.)