Remix.run Logo
LorenDB 4 days ago

Qt/QML can do all those targets as well (although it is admittedly jankier on mobile than Flutter or Swift would be).

palata 3 days ago | parent [-]

I never understood that. Qt is C++. The only valid reason to use C++ is "not having a choice" (which happens to me, too). But if you write a mobile app, I find it extremely weird to choose C++ instead of a modern language.

Disclaimer: I have seen teams writing mobile apps in Qt, and it was systematically a lot slower to develop, with a lot of pain, and resulting in worse apps. Even if you only have C++ devs, I would argue that it may be worth giving them the time to learn a modern language and write the mobile app with it.

rubymamis 2 days ago | parent [-]

Hi there! I'm curious about the use cases people you know used Qt to develop for mobile. Do you mind expanding on this?

I'd love if you could also contact me (my socials are in my profile) as I'm developing a set of components to help exactly in that situation.

palata 2 days ago | parent [-]

> I'm curious about the use cases people you know used Qt to develop for mobile.

They were developing non-trivial mobile apps. The kind where you use your fingers on a touch screen, but that are more complex than just showing a text and an image. Say Google Maps, or WhatsApp.

The problem was not the lack of components: the problem was that it was C++. C++ is more complex to write correctly than Swift or Kotlin and harder to debug. Which made those teams measurably a lot slower. It's just the wrong technology for the use-case, IMO.

rubymamis 2 days ago | parent [-]

I also write complex UIs with QML and C++. I do not consider myself an expert in C++ but there is clearly a subset of it that I feel comfortable in. I think the combo of QML & C++ is great since QML lets you focus on the UI - and does a great job at it, and in C++ you can write performant code. C++ isn't that complicated these days - if you stick to a subset you're familiar with.

palata 2 days ago | parent [-]

How much experience do you have writing mobile apps in Kotlin or Swift, as a comparison? I have worked in C++ for years, and in Swift for years. I have seen the exact same app being written both in Java and in C++.

> in C++ you can write performant code

This almost certainly does not matter for a mobile app, and definitely not for the UI part. In case your app has to do something that may need C++ (e.g. computer vision), then you can just call a C++ library over FFI.

> C++ isn't that complicated these days

I didn't mean that it is complicated. I can totally write C++. What I meant is that it is more complicated to get it right than modern languages. If users complain about a segmentation fault, it's often pretty tricky to debug. In Java/Kotlin, you will get an exception that tells you exactly which line crashed.

On top of that, C++ is slower to write. Again I have been able to compare teams working on the same app both in C++ and in Java/Kotlin/Swift (Java is not exactly a modern language, but still it's a lot faster to develop with).

And after all those disadvantages of using C++ for a mobile app, you end up with a UI that doesn't feel native to the platform.

Again: I still write C++ when it makes sense (usually that's for legacy reasons or libraries availability, otherwise Rust is a better choice IMO). But for writing a mobile UI? Doesn't make any sense to me.

Even for writing a Desktop app, I don't understand why people use Qt instead of e.g. Java. Kotlin/Compose seem to be coming on Desktop too, which makes a lot of sense to me. And maybe even Flutter.

Finally, I don't understand writing a cross-platform UI for Desktop and mobile. On mobile, I have a big finger and a small touch screen. On Desktop, I have a big screen, a mouse and a keyboard. Those require different UIs. Sharing the logic is fine, but the UI needs to be written for the platform.

rubymamis a day ago | parent [-]

> How much experience do you have writing mobile apps in Kotlin or Swift, as a comparison?

No, in the mobile space I've only used React Native and QML with C++.

> This almost certainly does not matter for a mobile app, and definitely not for the UI part.

I disagree. For example, I expect block editors to handle large texts efficiency - both in terms of power draw and performance. Writing in a non-compiled language already puts you in a disadvantage in both aspects. But this is just the standard I set to myself - the entire industry clearly has different priorities.

> I didn't mean that it is complicated. I can totally write C++. What I meant is that it is more complicated to get it right than modern languages. If users complain about a segmentation fault, it's often pretty tricky to debug. In Java/Kotlin, you will get an exception that tells you exactly which line crashed.

Yep, I generally agree, tho with good debugging tools and LLMs I have found this to not be a problem anymore.

> On top of that, C++ is slower to write. Again I have been able to compare teams working on the same app both in C++ and in Java/Kotlin/Swift (Java is not exactly a modern language, but still it's a lot faster to develop with).

I write in TypeScript at my day job and C++ for my side projects and I don't feel like I'm slower in C++. Again, I'm using the subset I'm conformable with.

> And after all those disadvantages of using C++ for a mobile app, you end up with a UI that doesn't feel native to the platform.

That has certainly been the case, and what I'm trying to fix - because I've proven that it is fixable by caring about UI/UX. QML is great for UI, it's just that Qt developers (both the developers of Qt and those using it) don't care much about those things. But it's definitely posiible to get good results. For example, I'm working on SwipeStackView like other iOS apps have in QML, and I'm liking what I've made so far: https://rubymamistvalove.com/notes-mobile-swipe-stack-view.M...

> Even for writing a Desktop app, I don't understand why people use Qt instead of e.g. Java. Kotlin/Compose seem to be coming on Desktop too, which makes a lot of sense to me. And maybe even Flutter.

Again, I can't stretch how FUN, easy, and overall a great experience to develop with QML and C++ together, it's just HOW GUI should always been. I'm thinking of creating some Youtube tutorials that will try to present this feeling.

> Finally, I don't understand writing a cross-platform UI for Desktop and mobile. On mobile, I have a big finger and a small touch screen. On Desktop, I have a big screen, a mouse and a keyboard. Those require different UIs. Sharing the logic is fine, but the UI needs to be written for the platform.

100%. Completely in agreement. The fact that you can develop both Desktop and mobile apps in QML doesn't mean you must make them share the same code (at least, not fully). I think Kirigami have gone the wrong way with their 'adaptable' UI (I've also thought about doing that until I realized it's the wrong approach). One should always start with the UX that the end result should be - never start from tech considerations.

[1] https://develop.kde.org/frameworks/kirigami//

palata a day ago | parent [-]

> Writing in a non-compiled language already puts you in a disadvantage

Both Kotlin and Swift are compiled.

> But this is just the standard I set to myself - the entire industry clearly has different priorities.

I think you just underestimate the performance of Java/Kotlin/Swift, languages that you admitted you don't have any experience with.

> tho with good debugging tools and LLMs I have found this to not be a problem anymore

Again: try modern languages with good debugging tools and LLMs :-). I think your bias is that this is all you know.

> because I've proven that it is fixable by caring about UI/UX

It requires care, which means more effort. All that for being at best similar to the native tools, but probably never exactly the same. And it cannot be better, because the native ones are the ones defining how it should be.

> I can't stretch how FUN, easy, and overall a great experience to develop with QML and C++ together, it's just HOW GUI should always been

But you said you don't have experience with the native Android/iOS way. I personally have used QML/C++, Flutter, Android (Java/Kotlin, the old XML way and the new Compose way) and SwiftUI. QML/C++ is by very far the worst.

I would advise that you try either Kotlin/Compose or Swift/SwiftUI to get an idea. You can still use C++ to share some code (say you write a complex library in C++, no need to rewrite it in Kotlin and Swift), but starting a new mobile UI with QML these days is just madness IMHO :-).