Most active commenters
  • vbezhenar(3)
  • peoplefromibiza(3)

←back to thread

Web Browser Engineering (2021)

(browser.engineering)
770 points MrVandemar | 13 comments | | HN request time: 1.035s | source | bottom
Show context
mannyv ◴[] No.41848587[source]
One great thing about this book is the 'stuff I didn't do' part.

Layout is really hard. Just tables by themselves are hard, even without any css around them. CSS makes layout impossibly difficult. I challenge anyone to keep the whole CSS spec and its associated behaviors in their head.

At this point css + html + javascript have become a dynamic PDL, and probably is one of the most complex pieces of software today.

As an aside, video decoding is offloaded onto hardware, so it's not as battery intensive as it used to be.

replies(11): >>41848643 #>>41848664 #>>41848729 #>>41848784 #>>41848785 #>>41849444 #>>41849487 #>>41849657 #>>41851786 #>>41852399 #>>41854447 #
1. vbezhenar ◴[] No.41848784[source]
This Babylonian tower will crumble one day.

Layout does not have to be so complex. There are dozens of GUI frameworks with simpler layout system. Those are enough for applications everyone uses.

replies(5): >>41849894 #>>41850107 #>>41851738 #>>41853975 #>>41855400 #
2. PaulDavisThe1st ◴[] No.41849894[source]
Actually, almost every GUI toolkit's scheme for layout has issues, and none of them are perfect.

The ones that use absolute pixel positioning fail when using different resolution displays.

The ones that use box packing fail when you need to deal with different sized displays.

The ones that use constraint programming fail when you need to layout hundreds or thousands of widgets.

CSS-style layout has its own pros and cons, but there is no alternative to it that is clearly better under all circumstances. If you doing layout and want to be resolution-independent, function on everything from phones to giant displays and have thousands of things to layout, CSS is actually likely better than any alternative.

replies(1): >>41860899 #
3. maxwell ◴[] No.41850107[source]
Which do you recommend?
replies(1): >>41868990 #
4. msie ◴[] No.41851738[source]
Pixel positioning is so nice! I remember how easy it was to layout UIs with VB.
replies(1): >>41857799 #
5. mardifoufs ◴[] No.41853975[source]
And they all have massive issues, or just provide a worse version of CSS (QT's qss, for example, as it's just a less well documented, non standard and very sparsely talked about CSS implementation. Oh and it doesn't work for everything in QT)
6. echoangle ◴[] No.41857799[source]
How does that work when someone resizes a window? I'm genuinely asking because pixel positioning to me sounds like hardcoding positions. Do you have to manually code the reflow when the window becomes narrow for example?
replies(1): >>41858493 #
7. vbezhenar ◴[] No.41858493{3}[source]
Pixel positioning usually anchors to a specific side. Like you can anchor label to the right side and it'll move as expected. And you also need to specify minimum width/height to keep thing sane.

Although it works poorly with translations, so it's probably not the best approach, but certainly one of the simplest. If you don't need translations, it works surprisingly well. Basically all Delphi applications used it and there were used a lot in private companies.

8. peoplefromibiza ◴[] No.41860899[source]
possibly, but videogames have been doing layout for ages without CSS and they can vary a lot from game to game while most desktop applications have basically the same 2-3 layouts: input and edit some text, fill in some form, display some data in a table, a tree or a chart
replies(2): >>41865670 #>>41875817 #
9. psd1 ◴[] No.41865670{3}[source]
Games lay out one game.

Document readers lay out every possible document.

replies(1): >>41867312 #
10. peoplefromibiza ◴[] No.41867312{4}[source]
> Document readers lay out every possible document.

you mean like vector graphic software, DTPs, word processors etc etc?

Flash did resolution independent graphics and layouts on the web back in the late '90s, we killed it - not without reasons - but we still haven't created a decent alternative to it

11. vbezhenar ◴[] No.41868990[source]
I've used Java Swing, Cocoa, Qt, Android. They are pretty good and were enough to build any kind of complex UI that I needed. I'm not sure what's the best one in the world, but generally I've found most GUI layout managers pretty good.

Even basic tools like those which were found in old Delphi, with anchoring components to the parent side, were sufficient for many UI-s, although some tasks like internalisation could case some pain.

In the end my opinion is that there should be a balance between usability and ease of implementation. Especially for technologies which are supposed to have many implementations.

12. PaulDavisThe1st ◴[] No.41875817{3}[source]
DAWs (digital audio workstations)

Video editors.

Image editors.

Web browsers.

Circuit, interior and architectural design.

None of these are anything like your "most desktop applications".

replies(1): >>41948490 #
13. peoplefromibiza ◴[] No.41948490{4}[source]
Just to be clear: when you name niche desktop applications you are literally saying that they are not "most of them"

BTW all of those applications you mentioned use many of the same techniques video games use (for the same reason: custom layouts), existed long before the web and are doing just fine without CSS