by SiVal · 9y ago · 0 comments
It's hard to tell how much of this emotional reaction is due to current reality, how much is leftover from old experiences that are no longer relevant, how much is just language preference (not platform quality), etc.
I could just try them all, but my experience years ago was that the cross-platform tech, when it worked, made things easy at first, but that final 5% of your code was always trying to find hacks to do what no one had ever tried before--very time consuming and risky (no guarantee of success). So "trying them all" won't really give me a true sense of where the technologies are in reality.
There's no rush in my case, but I do wish I had a more realistic sense of what the various desktop dev technologies were like these days in case I ever go back to it.
The thing with desktop applications is that an "industrial-strength" one needs to look native; thus it's in our best interest to use the native language of choice. This means that our Mac UI is Objective C, and we're very good at integrating Objective C and C#.
The other thing with desktop applications is that if you're doing something interesting, you probably need to call native APIs for OS concepts that are unique to each platform. A cross-platform environment can't do this very well; and we drop into C++ APIs on Windows and Objective C on Mac to do this.
The sweet spot for cross-platform development is your business logic, and networking calls. That shouldn't change as you move among platforms, and that should be the area that cross-platform development gets right. If you're willing to do this in C or C++, everything will be straightforward, but you have to deal with the warts of C and C++. If you need a higher-level language, it better integrate well with the languages you need to do your UI and low-level logic in.
I don't think this is the case for every application. It's definitely true for mobile apps, and it's probably true for desktop apps that are relatively small and/or use mainly standard OS GUI functionality.
But for things like Photoshop, or Office, or Unity/Unreal, too much of the UI is application-specific for it to really matter, and I think they benefit from a consistent cross-platform codebase and appearance.
I'm hoping this will turn into a good solution. Xamarin already supports Mac (in addition to iOS and Android) and when it aligns more with UWP (XAML Standard etc.) that could cover a large slice of the platforms you'd want to target.
React native could be another option. I hear Android support has gotten better and you can supposedly also target UWP: https://github.com/Microsoft/react-native-windows
I wrote this a while ago but it's still fairly relevant: https://unop.uk/cross-platform-native-mobile-app-development...
You could also look at https://github.com/AvaloniaUI/Avalonia or https://github.com/picoe/Eto.
If you need it to be offline and integrate into the operating system, then electron would be the next logical step in that direction.
If you want deep, and award winning support, you're going to have to write your product natively for each OS using native APIs. There's just no way around that requirement unfortunately.
The desktop became just another platform to target. Few cross platform apps can afford to not target the web with all of its benefits like instant, no install required delivery. A whole generation of developers is growing up on Webpack, Babel and React.
Who can fault Electron for existing?
As a user I mourn the cost at which this new wave of desktop apps come. If it were only memory I could buy more – up to a limit – but many of these apps put us back a good 10 years in responsiveness and even screen real estate. My workstation feels like a two year old phone. Who thought unchecking “Show window contents while dragging” would ever make sense again?
Luckily, to get to the original question, we are getting new options. I'm quite excited about Xamarin, which lets us provide a good experience on mobile, against the native toolkit if we like, but also a fast, familiar desktop app.
This isn't worth anything as long as we can't target the web and this is where I hope WebAssembly will bring us.
I remain hopeful. We must be able to do better than ship web browsers to our desktop users, but maybe we're not quite there yet.
I wish Oracle should do more with JavaFX, may be embrace JSX templates.
https://github.com/pauldotknopf/net-core-qml
The idea is to only have bindings for QML engine and it's parts, with the ability to use .NET objects (properties, signals, slots, methods) with vice-vera (using dynamic).
It is very much in the early stages, but to me, the idea seems very promising.
Windows, Mac, iOS, Android, Linux Server, cross-platform UI framework with native controls as well as native-themed ones. Runs on the GPU, vectorised, fast. Two languages, including C++ and Object Pascal (similar to C# in feel, but not C-style syntax.) Very large set of libraries for app development, server development, etc.
https://developer.telerik.com/content-types/tutorials/xaml-s...
https://github.com/pauldotknopf/net-core-qml
The idea is to only have bindings for QML engine and it's parts, with the ability to use .NET objects (properties, signals, slots, methods) with vice-vera (using dynamic).
It is very much in the early stages, but to me, the idea seems very promising.
Sure, it is based on a language which some people have aversions against (for unclear reasons), but it in fact does cross-platform GUI development almost flawlessly, and almost completely friction-less (no, or very little, code change to compile on the three desktop platforms).
Try open up a stable version on your platform of choice, drop a button on the form, double click and write some code (with autocompletion) and compile ... and then import the project on another OS and compile ... It's all a pretty mind-blowing experience, just how productive and "Just Works" the whole thing is.
To expand a bit, it compiles to compiled binaries in the range of MB, uses native GUI libs on each platform (GTK or Qt on Linux for example)... and you can now link it with a language like Go if you need some heavy multi-core processing, or need to access stuff that FPC doesn't have good libraries for [2].
It was discussed in depth here on HN just 5 days ago [3]
[1] https://www.lazarus-ide.org/
[2] https://forum.lazarus.freepascal.org/index.php?topic=24948.0
The more platforms you need to support with the fewer people, then the more web-based options may appeal to you. Electron works well enough for a lot of applications, and gives you the big three desktop environments. Judicious use of Cordova gets you the two big mobile options. It won't run as buttery smooth as native, and is very easy to let bloat if you don't keep on top of your dependencies.
Java is a bit less liked for desktop applications, mainly because they tend to look clunky, or are otherwise requiring a larger runtime as a prerequisite.
.Net has similar issues. For desktop applications the Xamarin tooling, now in the box, is a decent option, but you will get a few headaches. While I personally prefer C# as a language to Java, the latter is definitely got a bigger community.
QT, etc, are non-starter if you also need a mobile platform.
In the end it really depends on what you need to accomplish and what skills/tools are brought to the table. I'd lean towards using Electron/Cordova for any proof of concept just because it's easy to move fast on that side. I also happen to like Node a lot. You may also want to consider ReactNative as a first or second pass depending on your targets, again.
Firstly, there aren't any modern, serious, cross platform desktop development environments I'd describe as lightweight. That is not always a problem. If your UI needs are fairly straightforward and you want to use native widgets, then you can use Java+SWT or even AWT. It may sound ridiculous but for small utilities and such that want some buttons, tabs, menus and edits, you don't actually need a modern toolkit - and there are quite a few abstractions over native widget toolkits that work well enough if you aren't demanding.
Now what about the rest. You can see a screenshot of my app here - it's open source but I no longer distribute it:
https://media.coindesk.com/uploads/2015/01/Lighthouse-630x45...
I wrote a desktop app in Java for several reasons:
• It was a peer to peer app. Web and mobile don't really 'do' p2p networks.
• I had already written a library that was the engine of the app, in Java.
• Ignoring the P2P issue for a moment, my target market of early adopter cryptocurrency fans was split across several mobile platforms but all of them had laptops. Cross platform dev on the desktop is more mature than mobile.
• The app had a content creation component that wouldn't have worked well on small screens.
• I wanted to try new ideas in auto update technology, specifically, to enable signing keys to be held in a Trezor hardware device, and allow multi-signature auto updates. So that meant I couldn't distribute via an app store.
My experience of JavaFX was pretty good. It's the third gen UI toolkit after AWT and Swing. It's not abandoned by Oracle. It is however in maintenance mode. There is a reasonable sized team working on it but they focus mostly on bug fixes and rounding out the API these days rather than major new features.
JavaFX dates from around 2010, so it's a modern toolkit. To try and stay on topic, it's similar to .NET XAML. It has all the mod cons like a proper scene graph, support for fully reactive programming, GL/Direct3D based rendering with shader accelerated effects and so on. The design is very nice. The people who built it have done UI toolkits before and you can see their experience shining through. You can style with CSS and I found I could make a UI that looked like a Twitter Bootstrap app just by applying some CSS rules. Combined with a few simple rules (e.g. no menu bars, tree views, etc) I was able to make a UI that basically felt like a web app without actually being so. Nowadays I'd use TornadoFX which is a Kotlin framework that makes it even easier to use.
The big catch is always distribution. All desktop toolkits except Electron suck at this.
There's a tool that creates native installers for your Java app on Mac, Windows and Linux. The user won't know it's Java and doesn't need Java installed, but the resulting installers don't auto update at all. Acceptable if it's 1998 but not so much anymore. I rolled my own auto update framework as I wanted to make it high security anyway, and this wasn't hard, but it was never quite satisfying. I see that Electron uses a separate framework called Squirrel, maybe that's the way to go for Java apps too. But what I really want is an app browser.
I hit a few bugs along the way, none critical. JavaFX has spent the last few years with the team mostly focused on bug fixes and bringing features from internal APIs to the public API, and I felt it get more solid as I worked. Some glitches were platform specific but none were hard to diagnose or work around. It's no worse than any other framework.
Overall I much prefer JavaFX to the web platform. One was designed and implemented by a unified team with a unified vision. The other is a warty swampland which I'd describe as the product of evolution, except that evolution implies some kind of natural selection, which when talking about the web would be too kind. The web can do peer to peer video chat but does not have basics like a decent virtualised table or list view. JavaFX nails the basics all UI toolkits should have, but also supports things like composited h.264 and some basic 3D graphics. It can also embed WebKit if you find you need it.
My wish-list for JavaFX ends up being quite short. Integrate Squirrel for auto updates. Provide direct access to an underlying OpenGL context for more sophisticated 3D work (and let you force GL on Windows). Optimisations. Bug fixes. That's it.
[1]: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Supported_...
Native or Web on mobile projects, again depending on the use case.
Compare what Visual Studio + ReSharper does versus what Slack does. I have no idea what 70% of the features in Visual Studio do yet I'm using it professionally for years and years, there's just too much.
No, it doesn't. Visual Studio Code is an extensible IDE that is stuffed with features - yet it doesn't use that much memory, and it's fast.
And yet there are seemingly simple Electron apps that use a lot of memory and are slow - it seems, just like with any other framework, it's possible to write both good and crappy code.
When I first used Visual Sutdio it was VC++ 6 and I upgraded my machine to have 256MB of RAM so I could run it. What features does VS Code have that VC++ 6 didn't?
Spotify seems to be using a bit under 200MB.
For comparison, libre-office with a 60-row spreadsheet open is using 145MB.
Frankly, it's not that bad... I've got 16GB on my laptop (thanks apple), and 32gb on my home desktop, though may go threadripper at the end of the year with 64-128gb. It's there to be used.
VS Code is much more responsive than Visual Studio... and the plugins and integration are great. Integrated terminal, and the git integration are nice, though I wish they'd get closer to full 3-way merge support.
Source: https://www.quora.com/How-did-Spotify-make-a-multiplatform-l...
I've removed the Slack app because it's way too sluggish, just use the website when I want to check it.
I've tried Atom but it felt just not right, mainly because it lacked a certain snappyness - so I'm back to Sublime.
Sure when the users don't have any alternative they might bear with it, but a major selling point of a native app is that it feels right.