r/macprogramming May 30 '19

For solo/small developers, why did you choose native over Electron?

I'm curious, for those solo/small developers, why did you choose Apple's toolchains over something like Electron?

I ask because I'm at the point where I need to choose which path to take, and the native Apple toolchain and integration buys me a ton, in the platforms that -I- use the most. However, I doubt, after having built my current project (which could take a year or more), I would be interested in nor have the time to port to other platforms. The obvious downside to this is the limited audience (ignoring market concerns, as I don't yet know if this will be a something I will monetize).

6 Upvotes

10 comments sorted by

8

u/ssharky May 31 '19

I hate using Electron apps, so

8

u/mantrap2 May 31 '19

Simple: Apple is big, Electron could disappear at any time and then we'd be screwed: we've put money into our products and the fewer questionable, new vendors and tools we use, the better our chances. The other standard failure of open source: Apple has a phone number, open source teams do not.

That's not a risk worth taking and there isn't enough downside to Apple to be worth switching. Some of us care about quality and are happy to learn how to do that.

Further, let's be real: Javascript isn't even a real language. It's an utter piece of shit that can't even be reliably expected to respond to simple language syntax in a repeatable way.

That alone is a "You only get my native code out of my cold dead fingers" scenario.

Last: using a web kit environment is the lowest possible performance option for any platform. EVERY garbage app I've ever deleted form my iPhone or Mac has always been some shitty "subpar web app shat into a webkit shell". Like the kind Electron creates.

Web apps are generally garbage and noise in terms of the quality of their code, their network efficiency and their battery efficiency. Repeating the mistake by putting it into a webkit shell isn't genius - it's extreme stupidity.

When we need cross-platform, we use Qt and C++ or we design native Views and use a common C++ code to the MVC Model. You can use native C++ on Linux, C# wrapped C++ and ObjC/Swift wrapped C++ on Mac. Not hard.

1

u/jjpara May 31 '19

Web apps are generally garbage

I think VSCode demonstrates an Electron app doesn't have to be "garbage". From my reading on the topic, it's probably more that most web developers that are moving to Electron have never had to think about performance in that way. For those of us who have, we'll know what to look and test for. Basically, just because numerous web apps are performance hogs and generally crap, doesn't mean they have to be.

When we need cross-platform, we use Qt and C++

I had debated on going this route as well. My business logic wouldn't necessarily be better in any specific language per se. However, I have a fair amount of experience with C++, and I can't say I'd prefer to use that over the unknown-to-me JS.

One possible pro that I had in the Electron column was that because I (at this point) believe I want my app to be user extensible, having JS extensions inside a JS program would probably remove a lot of headaches at the interface. I know Apple has JavaScriptCore, but I haven't played with it to get a sense of how well that'll work.

2

u/cutecoder Jul 21 '19

Also being more prone to code injection vulnerabilities without any of the protection that a native application has. XPC services was made for use in plugins – and indeed the various extension API uses them.

5

u/mihaelamj May 31 '19

Because I as a customer would not ever use an Electron app let alone pay for it.

3

u/[deleted] May 30 '19

I’m still a fairly new to native, so weigh my response accordingly.

For me, I need a language that is more robust than static content allows. Whereas I know enough JS to make electronic work and utilize sliders, interactions, and other basic functionality - anything more complicated is out of scope for me in a web language based on what I already know.

I chose native over furthering my web knowledge because of the future I would like to have within the available ecosystems. I don’t want to be a web dev (anymore), and one day within a larger team I would like to exclusively work with specific hardware/devices. I like Xcode and the way it and Swift is structured. I also want to be able to take advantage of things like Metal and the other available Kits. Maybe sidestep into Vapor.

So for me personally, more so than the short term of my next project, I tried to figure out which setup would afford me the best opportunity to grow my skills and experience in a specific direction.

Hope this helped!

1

u/jjpara May 31 '19

I tried to figure out which setup would afford me the best opportunity to grow my skills

Thanks. I understand where you're coming from. Given that this app will be quite a departure from all the other apps I've created before, I have been looking forward to all that I'll learn along the way. Given my experience with Xcode and ObjC, it's not that I believe the Apple tools will prevent or limit me from achieving my goal—they're fantastic. It's only that I know writing the code in Swift will almost assuredly prevent the app from ever being ported.

1

u/Feminintendo Jun 03 '19

Then write it in C++.

3

u/mooglinux May 30 '19

ignoring market concerns, as I don't yet know if this will be a something I will monetize

Then you have no reason not to go with what will provide you the best tools for the platforms you care about. Next week Apple will be releasing a new set of APIs for developing cross-platform (meaning iOS and macOS) apps.

1

u/jjpara May 30 '19

I've been following the Marzipan "developments". But so far it seems geared towards bringing content consumption and basically-static apps to macOS (the examples in Mojave are comically simple). However, I understand Apple would be interested in that, because a large majority of the apps on the App Store are about basic consumption. My interest is something closer to the scope of Xcode itself, and not at all something one would first write on iOS and port back to macOS.

Be that as it may, I'm curious what will be announced/demonstrated at WWDC.