by pshirshov · 2y ago · 0 comments
If you want to write an app which will target all the major platforms (3 desktops and two mobiles), want a native look and minimal effort for every platform you target, there is nothing apart from QT. And it's a real pain to deal with unmanaged memory. Also, QT is a mess, you cannot define your interfaces declaratively (with QML) and easily interact with them from C++ code, you won't have any typings. So, you either have to go the ancient way of imperative UI definitions or do everything in QML which is total mess.
If you drop native look requirement, some small things like https://www.egui.rs/ might work for you.
If you drop the minimal effort requirement, all the webivew based mess might help you but it won't be easy due to multiple reasons.
The alternative, which I have found far more preferable: code app logic in Rust, which can be mapped to Swift, Kotlin and JS (via WebAssembly). I’m sure Go, Zig or whatever is capable of similar, I’ve never explored it. Then map that shared code to native UI.
SwiftUI and Android Compose are far from perfect but they’re 100x more understandable than what came before and have a lot in common with the React model of UI. It’s more work upfront but in the longer term I think it’s better to be using OS UI frameworks directly rather than adding a dependency between you and the OS.
At this point, if a tool doesn't support Windows, Mac AND Linux, I'm pretty unlikely to touch it. I know Linux is a minority here, but it's disproportionately large for developers on their own hardware at this point. I'm tired of working with things that don't advance what I can use on my own.
That "thin UI" can leverage a cross-platform toolkit for the long tail of lower value targets, that's completely reasonable because that's what they excel at. But you'll pay (a lot) for it later if it's not aggressively simple and disconnected from your internals, because those tend to have very painful major version migrations.
As a bonus: doing it this way generally gets you MUCH simpler and more testable core systems, and MUCH better accessibility.
This is always a very serious pain point no matter what solution you pick: the native platforms all have different controls and ideas about what your UI should look like. It's inherently not possible to have a cross platform true native UI - the best you can get is reuse of models and controllers, with a different UI layer on top.
QT does a relatively good job at that. It is possible. Of course there will be severe limitations, but in any case it would be better than total impossibility of building good looking multiplatform apps single-handedly.
doesn't mean they don't use QT on all platforms
but with different impl. for each with very little shared UI code if any
(but often shared code behind the UI, e.g. business logic, data validation etc.)
IMHO this is impossible (through a bit dependent on how you would interpret the previous sentence)
the way you would properly structure a app from a UI and especially UX perspective on mobile is often fundamental different then for desktop. Partially due to one group being mainly keyboard+mouse and one being mainly touch, partially due to one being mainly on "small screens" and one being mainly on at least 13" screens (tablets and very small Laptops are in a unlucky in-between spot)
to make things worse iOS and Android have diverged quite a bit wrt. "what is intuitive/expected"
through you can ease that issue by having just a slightly native look, but that can easily fall into a uncanny valley, and for proper UX you need to at least follow the native input handling, as in keyboard shortcuts, gestures, navigation patterns
this is why IMO "Cross-platform UI development is a total mess with literally zero solutions ticking all the boxes." is a mess because solutions end up either in a uncanny valley by being somewhat but not quite native for all platforms or in a good for one but not other platforms corner or you need to add a lot of manual platform specific customization. Worse it's often a mix where for some features some of the points above apply but for other features others...
through this doesn't mean you can't share stuff, e.g. sharing app business logic is quite viable, sharing complicated UI/UX logic for unusual custom elements is harder but should also work, but in the end (if you can afford it) using a platform specific UI library for Android, iOS is probably the right way to go. Through for desktop IMHO outside of having to have different Keyboard shortcuts you probably could use a mostly one size fit's all solution with at most slight tweaks.
Or that 64kB of RAM was plenty enough to make all the software we needed.
I would rather always dream big and help invent the future.
The issue lies not with the implementation but the requirements themselves. Each platform has its own design philosophies that either conflict with other platforms or, in some cases, are simply so vague as to be incoherent. Sometimes it even looks like competitive subterfuge.
That would immediately bring the world one step closed to the peace in the Middle East
- Native and easy UI on the three major platforms along with many more.
- Self-contained executable. (Zero dependency)
- Completely free and open-source.
- No restrictions on commercial products (unlike Qt).
Assuming no specific OS calls (or contained within IFDEF checks), you get your project you created on Windows and simply compile it on any Linux distro and you get a self-contained that will work for any other distro by simply publishing the executable.
It's a shame that this tool isn't mainstream for what it can deliver. Most complains I see are of those "old is bad, new is good" or "I want mah curly braces", referring to Pascal.
You can use a Material approach, and enough apps are similar enough to this, even in the various platforms that it can look "close enough" for many or even most things. Though Mac will be more oddly out as their apps tend to be far more consistent than with Windows or Linux.
One might also argue that we badly need just one desktop OS. For some reason this is not reality. Zooming in on the Linux platform, there is not even one native user interface to target for.
If you really want this, then your best option is probably a web-based user interface.