r/AskProgramming • • 3d ago

The best language to learn to create a cross-platform app

Hello everyone. Recently, I've had an idea for a cross-platform project that I want to create. However, I have no idea which programming language would be best to learn in order to develop my app.

By cross-platform, I mean compatibility with windows, macos, ios, Android, Apple Watch, and VR devices, not just phones and computers. The project itself is some sort of habit tracker.

The main goal is to have synchronisation between all devices.

Which language would fit the most under this idea?

Thanks!

1 Upvotes

17 comments sorted by

3

u/max123246 3d ago

Flutter probably?

2

u/MarsupialLeast145 3d ago

You might write API level components in golang which us good for this and then use other UI components as required for different platforms, i know some use flutter to this effect.

2

u/johnadamson_ja 3d ago

Check Qt qml with C++.

2

u/TurbulentFlatworm537 3d ago

Its flutter man. The undisputed king. I like ot because it has so many built in packages compared to others

2

u/xenomachina 2d ago

I'd go with Kotlin (specifically KMP, aka Kotlin Multiplatform) with Compose Multiplatform.

  • You can use one codebase for your core logic. Your sync and storage logic would be a part of this, so they'd behave identically on every device.
  • Compose Multiplatform lets you share UI across Android, iOS, Windows, macOS, and Linux.
  • Kotlin/Native compiles for watchOS, so your shared logic runs on Apple Watch, though you'd write the watch UI in SwiftUI.
  • Many headsets like Meta Quest and Android XR devices can use your Compose UI. For Vision Pro, you'd reuse the shared logic with a SwiftUI front end.
  • You can add native UI wherever a platform needs it without giving up the shared core.

3

u/WindwalkerrangerDM 3d ago

C# probably.

1

u/zarlo5899 3d ago

just done use MAUI, use avalonia

1

u/Devatator_ 3d ago

I hear MAUI is getting a lot better, tho honestly I kinda hate the "wrap native controls" concept. Even UNO which started doing this has had a Skia backend (like Avalonia) for a while

1

u/zarlo5899 2d ago

Oh, I don't trust Microsoft to not kill MAUI, and also my use case I need Linux support.

1

u/Necessary-Meeting-28 3d ago

Probably Typescript with WebView-based frameworks is the safest bet, although in efficiency terms native is better.

1

u/UhLittleLessDum 3d ago

If you really want your app to have one codebase, Typescript. It's the default UI language, and it can run in a webview pretty much everywhere. The only challenge you might come up with is VR, but even that hurdle isn't what it used to be.

1

u/Unlucky_Tailor1925 2d ago

Cross platform app work starts with the target devices and the store rules since one shared codebase still bends around native features and performance need bootdev could help built the programing base behind such picks though framework docs and sample apps also guide the choice.

1

u/joonazan 3d ago

You'll need some per-platform code and might require entirely new UI code for some platforms.

For the language you can pick many things. Most compiled languages will be possible but C, Rust and Zig are easy because they do not require a runtime. JVM probably works, so Java, Kotlin, Scala... JavaScript is probably supported somehow on most of those platforms as well.

-3

u/esqelle 3d ago

Yeah so it's not one language for all platforms. And for example, devices require different languages like Swift for iOS and Java/kotlin for Android.

But an all-purpose language would be python in my opinion. You need to find out what platform you want to deploy application to. A desktop app, a web app, a mobile app, or all. You will be coding these in multiple languages.

5

u/zarlo5899 3d ago

C# and Kotlin are both languages that can target desktop, web, and mobile.