Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



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.


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


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".


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


Games lay out one game.

Document readers lay out every possible document.


> 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


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)


Pixel positioning is so nice! I remember how easy it was to layout UIs with VB.


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?


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.


Which do you recommend?


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: