8 ms·
That's because CSS layout was designed by people who thought "float" and "clear" were a good idea, tables were bad, and, when in doubt, make it Turing-complete
by Animats 3y ago
That's because CSS layout was designed by people who thought "float" and "clear" were a good idea, tables were bad, and, when in doubt, make it Turing-complete and dump the problem on someone else.
2D and 3D tools get this right. CAD programs, game engines, and animation programs are all far better at positioning things. They have far better layout engines and constraint systems. This is really a constraint problem. Autodesk Inventor and Fusion 360 have good 2D constraint solvers, ones that can put something on a centerline, or parallel, or whatever, including curve tools. Webland never got that far.
- sdwr 3y agoWould setting constraints in the browser be feasible? Being able to define edges or midpoints that other elements can use for positioning. I guess it's way more complex than HTML rendering already is
- lifthrasiir 3y agoIt would be very hard and inconvenient to backport indeed. But webdev has moved much away from the initial HTML world anyway, so I believe it might be possible in a completely alternative rendering stack.
- troupo 3y ago> Would setting constraints in the browser be feasible? yes. IIRC Cassowary constraint solving was proposed in 1999. It was dismissed because they thought it would be too costly on the hardware of the time.
- dclowd9901 3y agoI think (despite the article’s digs) iOS had the right idea with everything having a relative layout to parents and siblings. It makes it much easier to know what “center” actually means when you have a notion of what it’s supposed to be centered to.
- codethief 3y agoCould you elaborate? I've never worked on any iOS apps before but this sounds very similar to what I'd like UI development on the web to be like.
- postalrat 3y agoDo the tools you say do it better than html also handle the variety of clients html documents are expected to work with? Or handle accessibility better?
- zamalek 3y agoXAML/Silverlight was pretty fantastic. Significantly more sane layout model (by virtue of having more than a mote of sanity at all). It did handle a very wide gamut of clients during its time. Why? Because it was designed for creating apps, not documents. HTML is great for creating documents, most of the examples in the post are not documents.
- bazoom42 3y agoIt is a weird myth that CSS somehow discourages tables. CSS have supported styling html tables and ‘display:table’ (allowing a table-like layout without html-tables) for 25 years. Float and clear was grandfathered into CSS since they were added to HTML by Netscape. They are fine for their intended purpose: placing images in a text and have the text flow around. Other positioning systems you mention does not solve the same problem as CSS. CSS has to support viewports of any size and dimensions and allow text to scale independently of the viewport size and still remain readable.
- dumbo-octopus 3y agoThis very website is built entirely on tables. (which, unfortunately, is why is has terrible zoom support)
- silon42 3y agoTables usually have much better zoom support than css hacks of old... Also, I often use 'zoom text only' in Firefox... that causes havoc on some sites. Also, I disable web site fonts by default.
- Moru 3y agoWhen people say not to use tables they mean <table><tr><td>for layout of the entire page</td></tr></table>
- justsomehnguy 3y ago> they mean They shouldn't had mean, they should had said that. Because 99% of time we have a bunch of <p> in assortments of <div> representing a tabular data. Dozens of "web" "front-end" "frameworks" doesn't help it in any way, too.
- Moru 3y agoYes, table for layout and table for tabular data is different things. This was usually very clear in advices. Don't use <table> for layout. DO use <table> for tables.
- andrewmcwatters 3y agoMan... whole generations just straight up either do not realize, or have forgotten that early CSS revolved around creating documents, not apps, and that all of those design paradigms originated from typesetting. In the same way that one would float a figure to the left or right of lines of a paragraph, `float: left;` and `float: right;` allowed you to do the same. Open a textbook and look at lines of a paragraph flowing (where content "flow" layout comes from) around a figure, such as an image or a diagram. The World Wide Web was documents. In this context, `float` was a genius idea. There's literally no other way in CSS to do this without a bunch of hacks.
- IshKebab 3y agoEveryone realises that. They just understand that it is a big problem with CSS. People wanted app-like layouts since before CSS was a thing. The problem is the people who designed CSS had an ideological axe to grind. They believed that HTML should only be used for document layout.
- pixelfarmer 3y agoBut that is the fundamental problem behind all of web nowadays: It was initially designed for documents; there are precursors for this entire HTML stuff (hypercards and similar things). Funnily enough, there existed tech even back then that was much much better at dealing with actual applications and their requirements. Unfortunately, many stupid idiots decided to use the "web" for that instead and mangle something aimed at documents to hell and back to actually do apps with it. The amount of time (of humans) and resources (not humans, but computing power, energy, ...) wasted on creating and running kludge after kludge to coerce the "web" into "something for apps" is absolute insanity.
- mietek 3y agoYou reference HyperCard as if it was only a document creation system; it was not. People have been building applications in HyperCard from the start. https://hypercard.org https://hypercard.org
- ozim 3y agoI don’t think it was that tables were bad. They were too formulaic and too strict and it was hard to do something that would stand out. With CSS it wasn’t dumping problem on the others, it was giving the freedom. Problem with freedom is that it is never free and you also have to fix additional problems that come with it.
- watwut 3y agoThe issue with CSS is not too much freedom. It is that as an API, it is frankly, retarded, horrible and ridiculous.
- 6510 3y agoLong ago I made interfaces with image maps. Just one giant jpg with all links boxes and text on it. https://www.w3schools.com/htmL/html_images_imagemap.asp https://www.w3schools.com/htmL/html_images_imagemap.asp https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ma... I've seriously considered doing websites in pdf too but still have to run into a situation dramatic enough for it to be worth it. Now that I think about it again "installing" a pdf on a pc could cover a lot of app like functionality. Most important is to make it as convenient as possible to remember your business exists and interact with it. http://fpdf.org/en/script/ex95.pdf http://fpdf.org/en/script/ex95.pdf
- eichin 3y agoactive (PDF) documents seem to have become a thing on eReaders, especially pen-based ones; mostly they leverage clever linking and bookmarking, and not much more, though.
- atoav 3y agoThe problem I see with using tables for layout is that it fucks up the semantic meaning of the html file. But that was an issue of philosophy that got trumped by practical needs. However, nowadays we have css grids with template areas. So we can just write our HTML semantically correct as if it was more or less just about the content (as it should be IMHO) and still move things around using CSS depending on the type of device, size of screen, media used. So the holy grail in my opinion is to write HTML that contains only content and metadata and next to no elements or attributes that are needed purely for semantically irrelevant layout and styling purposes — and then do all the layout and styling in CSS. Styling tags like <em> or the occasional <section class="notice"> are okay, one should never be too strict with such ideals. The advantage here is that this provides the maximum decoupling between the content and the layout/styling which not only helps with future layout updates, but improves the accessability of the page.
- globular-toast 3y agoThat's because CSS is for styling documents, not applications.
- 3rd3 3y ago> 2D and 3D tools get this right Except for (vector) graphics design, desktop publishing, page layout designing and reporting software... The reason is of course that most printed items are unica and non-variable, but proper parametric and constraint-based would definitely be useful in report generation and signage where print formats vary or where designs need to be automatically adjusted based on texts and other content varying in size/length.
- AlienRobot 3y agoThey probably thought we would ditch HTML/CSS for something better but then PHP came around and fixed many of HTML's shortcomings and then AJAX came around and we kept sinking DEEP into this fundamentally broken ecosystem and now it's just too late to leave. Although, honestly, how hard would it be for Chrome to support some new language called Super Text Markup Language that is designed for modern use with support for templating, portals, actual semantic layouts that don't rely on position on the code, etc.? Perhaps it's time.
- Animats 3y ago> Although, honestly, how hard would it be for Chrome to support some new language called Super Text Markup Language that is designed for modern use with support for templating, portals, actual semantic layouts that don't rely on position on the code, etc.? Perhaps it's time. "Google Web". Like what Google did to USENET. First they connected to USENET. Then they called it "Google Groups". Gradually, free USENET declined, and now, there is only Google Groups. It would be so much more convenient. No more need for hosting providers, domain services, and most of AWS. Just host on Google Web.
- Tossrock 3y agoFunnily enough, Unity's latest UI approach is to just use web tech, with their 'UML' XML dialect plus CSS-like styling via the yoga embeddable C++ flexbox renderer. Also, Fusion 360 is now known as just Fusion (it's cleaner that way?)
- thomastjeffery 3y agoThe difference is (literally) semantics. What design tools express in UI/UX interaction, CSS must express in context-free grammar. It's every bit as awkward as replacing verbs with nouns.