Hacker News new | ask | show | jobs
by rolleiflex 2746 days ago
Everyone intrinsically understands that native is better, and I'm saying this as somebody who runs a 120k LoC Electron app (https://getaether.net) myself.

I'm painfully aware that native is better, all day, every day.

The problem is this: I'm a solo founder. I am both the engineer and designer (and PM). The alternative for me would be not to write a Mac app, a Windows app, and a Linux app separately, and have them work.

The alternative would be for Aether to not exist.

You're expressing a sentiment that everyone feels, but you're off on why — it's not change aversion, but the simple fact that these technologies make trying new things cheaper, things, by definition, that would be too expensive to try in slower-to-build tech.

In my case, a compromise I found worked was to use JS for just the UI and write all code that does something in Go. Since that code is native binary, it's fast and efficient. Vue in Electron handles the 'client' UI, and interacts with the Go app binaries via gRPC.

2 comments

But why Electron? There are other cross-platform solutions with great performance.
There are no equivalents to electron. You either use a browser, or you get stuck in someone else's lacking UI, like qt. Electron just works, and that's why it's everywhere.
Qt actually performs better than Electron and works everywhere and
What you want is cross-platform:

  - Web (IE, Safari, Firefox, Chrome, and older versions of those browsers)
  - Web responsive (When you access it from small screens or access the web from your phone's browser)
  - Android (old devices to recent ones)
  - iOS (old devices to recent ones)
  - And, eventually, get to a desktop app, ideally on windows, mac and linux.
Say you're the tech lead and you need to make a decision about the stack to support all these platforms, and you're a team of 2-3 devs, yourself included. What stack do you pick?
The fact is, only very rarely are you in a team of 2-3 devs and you need to support ALL of these platforms. If that’s the case for a small startup, serious strategic errors and lack of focus is being made by the founders!

Even Instagram didn’t even have an Android app until they were acquired, and then it still took them another couple of years to support web. Their focus was their success.

To be fair, Instagram didn’t have an Android app a long while ago. The Android market & demographic has changed a lot since, with high-end Android phones sporting great screens, cameras and costing nearly as much as the iPhone.

An Instagram launching today would see much greater pressure to be on Android sooner rather than later.

Depends on what you're building. But sure, if you can remove the "cross-platform" spec. and say just build a desktop app on Linux, use whatever suits your boat.

Personally, I find it amazing to have one engineer builds a feature end-to-end from the server to the web/mobile devices by using the same language and re-using 90% of the code across all the clients.

Seconded this. The downside is you have to use C++ to beat Javascript performance. You can use Python of course but it is kinda slow.
The first version of Aether was in fact just that, Qt + Python. The performance was abysmal.
I agree with you that on desktop the situation is a bit different. I 've only played around with UI on OSX, and for some reason it is way harder than native ui on ios (old NextStep api vs UI api). Fonts are handled differently. The coordinate system is different (starting from the bottom left corner if I remember correctly). Coding for multiple screens; like tracking pointer position on windows on different screens is awkward. Lots and lots of legacy stuff.

Perhaps windows is better? What about linux? :p But I see why people are disliking the native ui situation on desktop.

Native UI is nice for system dialogs and programs associated with the system in some manner. I wouldn't want a harddrive formatting software to be using some transitioney css+js.

But I would want my media player, or chat application, or something that's meant to be a media-based experience to be well presented.

I took a look at a large list of apps that uses electron. I found three that would actually have significant user bases. It might be used everywhere, just no one is using the result.
> The alternative would be for Aether to not exist.

Do you really think the only options are to target all platforms or none? There's nothing wrong with being platform specific and building other clients later, if you were specifically building an MVP then this would be the minimum.

You’re already limiting yourself by being desktop only, which I have to for the time being, because of its P2P nature. At that point, you don’t get to choose what to support.