101 points · by delvin0 · 6y ago · 230 comments
>In fact, writing software with C/C++ was hard because developers had to work with different operating system API(Application Programming Interface).
Seriously ? Writing C++ apps is hard because you had to use different APIs ? That's the least problematic part about C++ app development, behind say the fact that your app can segfault when dealing with strings... (and especially pre C++11) or that you could take lunch breaks during builds which kills GUI iteration.
I feel like this doesn't belong on front page and people upvoting this are doing the site a disservice by upvoting based on title alone.
If you did apps in days where C# and Java took over for C++ mobile still wasn't a thing and macos was super niche (especially in enterprise) - few people really cared about cross platform - demonstrated by C# being windows only and growing in popularity during the time.
Visual Studio dev experience was just better than anything comparable at the time (Borland stuff was dead by C# era) and C++ was just an inferior language for app development (especially pre modern C++ where you couldn't even rely on stl being implemented correctly across platforms and people regularly rolling their own containers)
1) people now expect apps to run on a million different devices and nobody has the time or resources to develop four or five native apps with feature parity between them
2) progress on UI frameworks is pretty much stalled. Just looking at .NET, because I'm familiar with it and traditionally desktop software has been a big area of concern for it, Windows Forms will work for forever but hasn't been touched in a long time, WPF has some sharp edges that make it feel unfinished but isn't being touched, and WinRT was basically stillborn because of their attempts to tie it in with the whole "new" Windows 8 ecosystem. Meanwhile, browsers are getting new capabilities constantly. It's hard to blame anyone who looks at that mess and says to hell with it and goes with a Web browser-based solution.
I’m much more optimistic about the future of native apps, the best ideas from the web are already making their way into Rust and the recently announced .NET MAUI, and with WebAssembly I think we’ll start to see native performance on the web instead of the other way around.
I wouldn't be so sure about that. WebAssembly doesn't do anything to help the rendering bottleneck. To do that you really have to replace (or innovate in some way) the DOM.
Can you recommend any projects to check out?
Iced is taking the "get something working now" approach, whereas Druid is taking the longer term "build it right" approach. I wouldn't recommend either of them for serious projects yet though.
I would also recommend Raph Levien's blog https://raphlinus.github.io/.
I’ve used a lot of UI frameworks and getting to do anything complex is always much harder than doing the equivalent in HTML/CSS/etc.
I don't think it will take too long for the niceness of a sane design to outweigh the lack of features.
The only thing I'm not convinced about is that Flutter-web will ever be viable for most web pages (i.e. non-app ones). It kind of works but it's big and slow. Probably eventually people will do a native website, and then use Flutter for mobile and desktop.
https://korban.net/posts/elm/2019-11-17-elm-ui-introduction/
WinForms very recently got HiDPI support, better accessibility features, and was ported to .NET Core where they also fixed bugs in some controls.
WPF in the meantime has been arbitrarily declared stable and Microsoft refuses to fix anything. Everybody is supposed to switch to UWP which they already deprecated or WinUI which hasn't been released yet.
Sure writing large apps is not going to be straight forward, but WinForms is super simple to get started with.
Simple use case: Make a sidebar fade in and fade out, while changing the dimensions of the right box. Pretty close to impossible to implement in a clean manner, even within glade.
And then, try to support a mobile device in a responsive way with libhandy.
Now you throw the towel and just get on with 20 lines of CSS and literally two HTML elements.
CSS should not be underrated when it comes to layouting. It is super flexible, and UI frameworks always will lack behind due to their architectural patterns.
That is why so many apps don't work bug free with other themes. There's no way to predict how your app will behave on another system with another theme.
So personally I think the mess of overused dummy css classes in the GTK ecosystem is really a bad design. They could've gone with custom, namespaced, ui elements instead of that box.something.something shit.
They reinvented divitis. Quite literally.
It amazes me how many people went with the .NET bloatware and all that follows it. Of course, 95% of programmers out there are newer than me and don't have knowledge of this type of efficiency to compare against.
Delphi and C++ Builder are still around, but now only some lucky enterprise employees get to play with them.
.NET Native and C++/CX were finally shaping up to be Microsoft's proper version of what .NET and Visual C++ should have been all along.
However they are the most recent victims of the whole Reunion reboot, .NET Native now has uncertain future, while C++/CX got replaced by C++/WinRT with a tooling at the same level as doing C++ ATL 2.0 in 2000.
Still, there is a certain guarantee of the underlying platform and respective languages being around.
Borland mismanagement was my hard lesson to only use tools from platform vendors. Not only did they decide to leave the indie developers, they were always late providing bindings to Microsoft SDKs.
LOL, "lucky enterprise" my ass. The only poor souls who still work with that shitty bug ridden stone-age IDE from Embarcadero have to do that because they never managed to get rid of VCL (which might have been nice 20 years ago. Today it's just bad compared to modern frameworks).
Stay away from Embarcadero, don't become dependent on such vendor lock-in.
Field required: First Name
Field required: Last Name
Field required: Email
Field required: Password
Field required: Verify Password
Field required: Company
Field required: Phone
Field required: I have read the Community Edition End User License Agreement and confirm that my usage of the Community Edition version complies with its terms and conditions.
Field required: I have read, understand and agree to Embarcadero's Terms and Conditions & Privacy Statement
Field required: Yes, I would like to receive marketing communications regarding Embarcadero products, services, and events. I can unsubscribe at any time.I remember Delphi adding many Windows features before Visual Studio. Windows Vista Aero support, Support for building native apps for the Microsoft Store, etc.
Delphi never shipped with bindings for 100% of the APIs, but the beauty of Delphi was I could create my own bindings with only a little code from Delphi, so it wasn't a roadblock. That is the huge difference between Delphi and non-native development tools: You aren't held back by lack of libraries or API bindings.
https://stackoverflow.com/questions/9653260/resources-for-na...
Also how come Embarcadero supports Windows features before Microsoft does?
I am a big Object Pascal/C++ Buider fan, but also acknowledge the reality of their actual support.
While I like the idea of .NET AOT, the execution left so much to be desired. The developer experience is so bad that I’m shocked that it’s still required for Store UWP apps.
With the store sandboxing Win32 apps instead.
https://github.com/dotnet/designs/blob/main/accepted/2020/fo...
https://github.com/microsoft/ProjectReunion
My biggest grip with .NET, since 2001 alphas for MSFT partners, was not being AOT like Delphi (NGEN was never meant for anything other than fast startups).
It doesn't amaze me. It's very productive to work in and the bloat just doesn't matter that much in most environments where .NET is even on the table. Now that prevailing trends are different, you can build leaner .NET Core apps.
...and a computer having 32MB of RAM was considered outrageously luxurious.
MFC with C++ was using dynamic linking by default, but you could always switch to static and see the binary bloat to several MiBs in size.
So if you do a proper comparison, there's really not much difference between them.
This is why Apple has been so hostile towards PWAs.
It's totally possible to build a PWA that behaves like a native app but Apple actively tries to destroy them.
There will never be a viable hybrid app platform.
It may look the part but it rarely feels like it.
Something like OmniGraffle would not end up feeling the same. Even Microsoft's apps on mac feel better than their web-based counterparts in O365.
Slick web apps are taking over the software world, whether the likes of Apple want them to or not. Looking like any specific native platform is less important, if it's even relevant at all, in an era when users are working with different web apps each with their own look-and-feel all the time anyway.
There is nothing magical about Ui powered by compiled vs interpreted code. It is limitations in the platforms that are the roadblocks.
Our users (https://usebx.com) seem to appreciate the native performance and feel of our web app.
Seems to me that there's less of a "apple is purposefully malicious towards PWA because of their master plan for platform lock" and more of a "apple has a very long history with being completely incompetent on the web (see: icloud as a whole, safari now slowing standards adoption, newer web endeavors like the apple music app) which in turn is slowing PWA adoption because they now own one of the most dominant mobile platforms.
[1] https://www.businessinsider.com/microsoft-xbox-game-pass-app...
[2] https://www.theverge.com/2020/9/25/21455343/amazon-luna-appl...
Ugh, no. No it's not. At least not yet.
Accessibility features alone are almost always woefully crap in web-apps, compared to what native apps have access to, at least on macOS (and SwiftUI is amazing in how it lowers the barriers in implementing accessibility in your app from the get-go.)
Shit like Electron and PWAs seem to be championed by user-hostile developers that just want things to be easy for themselves, without considering what's best for the users and their hardware resources.
There is a standard counter to that argument at this point. Developers on native platforms might be able to achieve a better experience on that platform than a web app given the same time and resources. However, if the time and resources have to be split N ways to build a native app on each of N platforms, compared to investing everything into polishing a single web application, the outcome might be very different. While each native developer is still worrying about whether they're aligning and labelling a button in the platform-standard way, the web team is already refining their UI using the results of their third round of usability testing and has determined that the button shouldn't have been there in the first place and designed and implemented a more intuitive UI. And since they launched their version 1 two months earlier than any of the native apps did, they even have the extra revenue in the bank to pay for those usability tests, too.
Your hypothetical scenario seems to be treating the app's UI as if it exists in a vacuum, rather than existing alongside other apps.
If there's a platform-standard UI convention that applies to a button, then UI testing in the context of that platform is probably not going to tell you to remove that button entirely—you shouldn't be surprising users by removing functionality they expect to find present. And if there is a UI convention that tells you how to position that button, you probably shouldn't A/B test the positioning of that button and should focus your usability testing on the UI elements that are not dictated by the platform's standards and conventions.
Not an Android fanboy but I'm going to assume that the bigger (widely used/constantly iterating) "platform" (for a lack of a better term) has better a11y. And if there is a web framework that provides this (react?) do the majority of websites use it ? like they do native api's for native apps
(and this isn't even talking about the api's accessible to native vs web app)
Google is developing cross-platform Dart/Flutter.
Apple is developing cross-platform Swift/SwiftUI.
Facebook made React and then cross-platform React Native.
Native OSs can be built to be "cross platform". For example, the OpenGL API. The same API works on different OSs, developers can code against the same API and it works on different OSs. In an ideal world, maybe there could be a standard API for presentation controls, UI drawing, animation, 2D/3D graphics, networking, filesystem access, threading and more. Each OSs would implement the same API and add additional platform specific APIs to differentiate themselves. The key is application developers would have a common core set of APIs and language to implement the 80% business logic and UI logic.
Note, this is essentially what HTML, JS and CSS is doing. But the web platform is creating a runtime that exposes APIs to do a lot of different things. A CSS transform a single API that causes the DOM to animate in specific way. There are thousands of these APIs, and the runtime implements all of them. This is why the web runtime itself heavier and it takes 100mb just to show something simple on web platform.
For flutter, the core engine is just a 2D drawing surface, the APIs it exposes is just drawing shapes. And all of the widget self contains rendering, various settings and the application pulls in the widget used in the app. This makes the runtime smaller. Flutter is more efficient because the abstraction is lower and the core runtime is trying to do less things. On the scale of level of abstraction, flutter is on one end and the web platform is on the other. For our ideal OS platform, we can select the right level of abstraction to balance between performance, standardization, and flexibility.
But in the real world, all of this require collaboration between OS vendors. Apple's business model is try to sell more IPhone, Mac, Apple Watch, IPad. They make the argument that Apple's platform has the best apps that isn't available on Google's or Microsoft's platform. And this actually works. Why is Android tablets not taking off, and IPad Pro is? People buy the IPad Pro for apps like Notability, Photoshop and more. People still buys Windows and not ChromeOS because its got native Photoshop and Matlab. These apps are coded using Apple's or Micosoft's language, frameworks and APIs. And that exactly is what is preventing these apps from appearing on Android and ChromeOS easily and reducing people's need to buy Apple and Microsoft's devices. While these vendors may not say they are actively trying to lock in developers. They definitely don't want the some developers who coded an complex application for their platform to easily move it to another platform. If this transition cost is too low, it doesn't play into their business model. Their business model pushes them to differentiate their platform against others, and as a side effect, it increases the barrier and transition cost.
This is a tug of war between application developers desire to have all platform as similar as possible, and the platform owners desire to differentiate their platform and prevent other platforms obtaining the same capabilities as my platform.
Desktop apps got the permission model all wrong. You run a program and that grants them access to everything.
The web's model is closer to that of mobile apps. It asks for a permission at the time that it's needed. Not all sites get this right, but browsers are starting to crack down on requests the moment you enter a site.
https://medium.com/javascript-scene/native-apps-are-doomed-a...
I did this with the Eclipse Language server and my memory usage cut in half on the same project.
It's essentially only using HTML and JS as the UI engine.
Even my 9 year old laptop can run VSCode just as fast as my 3 year old main machine.
Back in 1998 when Visual Studio 6.0 (actually just the second publicly released version) was released, it took ages to load and used up quite some RAM. 6 years later, when I switched to VS.NET 2003, VS6 ran super fast on my PC.
The difference was, however, that my 1998 PC was a 300MHz Pentium II with 64MB of RAM, wheras my 2003 machine was a n overclocked AMD Athlon XP at more than 2500MHz with 2GB of RAM.
Now compare that with my 2011 laptop vs. my 2017 laptop: my 2011 machine has a dual core 2.5GHz CPU with 8GB of RAM. My 2017 laptop is a dual core 3.5GHz CPU with 16GB of RAM.
22 years ago, 5 years of progress meant a 10x increase in RAM and 8x increase in CPU speed. During the past 10 years we saw a doubling in RAM (barely, TBH) and maybe 1.5x in CPU speed (at the same core count).
That's why the old software felt so fast - because we used it during a time when a major PC upgrade actually meant something. If you used a software package for five years, you could actually see more than a doubling in performance (e.g. Core2Duo E8600, 2008 vs Core i3-4350, 2013 [1]).
That's just not the case anymore and skews our perception regarding performance heavily towards "lean" vintage apps.
[1] https://www.techspot.com/article/1039-ten-years-intel-cpu-co...
I distinctly remember subsequent versions (.NET 2002, which I think had the UI re-written) being a lot slower than 6, and me still using version 6 when I could because of this.
In fact, I can remember VS 6 opening in seconds, compared to later versions being much slower.
And it isn't an IDE, rather a programmer's text editor.
What Electron gets mostly right is the UI, since everybody is used to browsers. What it gets wrong is insisting on shipping an entire browser rather than using the platform's native webviews, so the result is ridiculous bloat.
Before starting my app, I did briefly consider going the cross-platform route, and I realize that it's possible to build a decent app that way. But personally, I could always tell when I used one. Little things like swipe gestures and drag and drop didn't quite work right. The extra polish, consistency, and speed of going native is so nice for things you use all day every day. With the shift to remote work, people might notice this extra 5-10% of polish more than they did a year ago.
Interpreter written in Assembly for fast startup, if the application was never executed.
Followed by JIT compilation to native code and when the device is idle, the PGO data collected by the JIT is used to produce a binary for direct native execution.
As of Android 10 those PGO files are uploaded to the stores and then if a similar device installs the application, they will get the PGO data as well and thus achieve a relatively fast result for their initial compilation.
I know that a lot of old school code used very little memory due to everything sharing one set of libraries. I wonder if in the future, “installing an application” could be flipping a bit in a registry and your device being delivered a highly optimized monolithic system image.
I think that's pretty much what a good compiler is meant to do?
smaller binary images would be amazing though, especially when OS dependencies are required
In Catalina it’s crashing left, top, bottom. Moved to nvAlt which, it seems, is abandoned now as well. Author is focused on something caller nvUltra. No idea what’s that.
Besides for people who use Evernote, nv isn’t a replacement at all for them.
No sync, looks like it won’t let me put images/PDFs in, no way to collaborate with my co-writer on projects, last version is from 2011. Nope. Haven’t tried it, don’t think I will, I dunno who it’s for but it’s not for me.
In order to run such stacks we need to devote a couple of GB's of RAM for the OS and browser. Not a bad deal if you compare cost to benefits.
That said, I normally seek native apps where possible (ripcord for slack, sublime), but that's also pretty hipocrytical of me ref Kanmail!
I've started publishing Sciter.JS builds to prove that:
https://github.com/c-smile/sciter-js-sdk
Those binaries contain HTML5, CSS 2.1 + some Level 3 modules and full ES6 engine.
4-5mb of binaries is comparable with native hello-worlds of purely native Qt, wxWidgets, etc.
(See the fact that you can use it after a click, how can i do the same with paw ?)
You also need to expend several more clicks to install a browser extension to get the same level of functionality that Paw has.
What kinds of wild things could we accomplish on this hardware if we weren't bogged down in gigabytes and teraflops of bloat?
Not that many: An early 1990s PC platform could be thoroughly described in a 200 page book and you could write a boot loader for the CPU, a VGA driver, and drivers for the most common peripherals from scratch in a few weeks.
In fact, games of that era shipped with their own audio drivers, (C/E/V)GA libraries and peripheral support.
Today this would be a) impossible because many manufacturers (cough NVIDIA cough) don't even release OSS drivers and specs and b) individual programs don't own the hardware anymore - the OS does. Also the multitude of target platforms (CPU types, -core counts, and -speeds, graphics cards, peripherals, etc.) makes it virtually impossible to ship code that it optimal for each of even the most common combinations of hardware.
The final nail in the coffin of the "super lean no bloat why-not-just-unikernel-everything-for-maximum-performance" idea can be summed up in one word: cost.
Development costs would be insane if we started optimising every aspect of every program for performance (on every possible platform, no less), memory use, and (binary-) size.
And that's even ignoring the fact that it's more often than not outright impossible to optimise for binary size, runtime performance, and memory footprint all at the same time.
Plus interactions between programs (plugins, {shell-}extensions, data formats, clipboards, etc.) require "bloat" like common interfaces and "neutral" protocols.
Most of the myth of great "old software" comes from the fact that functionality was severely limited compared to modern apps and that many folks simply weren't around to actually see and feel how much some of them actually sucked.
Sure, Visual Studio 6.0 runs incredibly fast on a vintage 3.2 GHz Pentium 4 with 2GiB of RAM using Windows 2000 - but when it released in 1998 many PCs had a 60MHz Pentium 1 or a 100MHz 486DX4 with 64MiB of RAM and it ran like a three-legged dog with worms on these machines compared to the DOS-based Borland-C...
Speaking of which, remember when sometime around the 2000s all Borland Pascal program stopped working, because CPUs had become too fast (>200MHz IIRC)? That was because their runtime used a loop to determine how fast the CPU was, which caused a divide-by-zero on fast machines IIRC.
Good times indeed...
>many PCs had a 60MHz Pentium 1 or a 100MHz 486DX4 with 64MiB of RAM and it ran
By 1998 most people switched to a Pentium because of the huge performance gain. And by 2000, everyone had a Pentium2 with ~96mb of RAM.
Reminds me of the Turbo button on PCs in the 90s, which all my school mates and I at the time thought was for a speed-up.
Au contraire!
My daily driver has 4GB of RAM, and it's possible only usable because I'm extremely frugal with my software choices. I run Debian with XFCE and pipe memory usage to my panel so I can always see whether I'm in danger of swapping. I use a Firefox extension that prevents me from opening too many tabs. I stick to the terminal for as many tasks as possible. I categorically refuse to use electron apps. And despite all that, I still ending up OOMing and having to hard reset every few days. For a normal person who doesn't know what RAM is and has an antivirus constantly running the background, the 4GB are going to be used up almost immediately, their machine will start swapping, and then they'll get the impression that their 4GB machine is "slow," despite being faster than high-end computers people used to do exactly the same things ten years ago.
I know how to fix it for myself (I have scripts to do it automatically) but most people do not and just reboot when the system becomes too unresponsive. Not so great for 2020.
Are you sure it's not the "150 IQ I-have-20-tabs-open-at-any-given-time" usage pattern that's actually causing this? I just checked out of curiosity and Edge (for lack of an installed Chrome) used "just" ~380MiB for a rather big website.
Sure, websites (and especially ads!) taking up unnecessary amounts of memory and performance play into this, too, but the expectation that you can just leave 10 bloated websites open on a glorified netbook from 2014 is more to blame than anything else.
Sometimes yes, but;
And how are non technical users supposed to know they should not do this? A lot of people do not know how bookmarks or even ‘windows’ work so they leave open the websites they visit so they do not forget them or have to open them again... How would they know that this is bad? The browser supports it and no one told them. For them there is no correlation between tabs and computer slow. Just as many people, when you say ‘your memory is full’ start throwing away picture from their drive. I think you vastly overestimate computer users... I am ‘the computer guy’ of the village because ‘I do stuff with computers’ and I run into the strangest things all the time. There is, for instance, a large stack of perfectly fine laptops in my house because some people just bought new ones because the old one ‘was slow’ and they were fed up.
Also, what do tabs open have to do with IQ?
'But Larry Page and Google were not interested in application software. “We like the web,” he is said to have told Lars Rasmussen, one of the Gordon’s fellow co-founders. And he set the team a deadline to get their idea working in a web browser.'
Source: https://medium.com/@lewgus/the-untold-story-about-the-foundi...
Personally, I don’t see much benefits of Electron or non native apps when they don’t mix well with the OS UI interaction model. In the end you need to implement a lots of parts twice for Windows and macOS due to the differences interaction models.
In the case just share the business logic, and write UI separately, works perfectly fine. I have written apps that run on the web, natively on Android, macOS, iOS, and Windows were the only change is the UI layer and data storage (e.g. iCloud on Mac etc)
I have about 500 applications on my Mac (465 in the Applications folder and at least a few dozen others scattered about), and I believe only two of them are hybrid apps (Visual Studio Code and Discord). There might be another two or three I'm forgetting about.
In other words, somewhere between 99% and 99.6% of all my applications are native, and I see zero reason to believe that percentage will decline very much in the next few years.
Here's a list of about 60 apps that I've used in the last month:
Activity Monitor, Adobe Digital Editions 4.5, AppCode, Bartender 3, BBEdit, BitBar, calibre 4.23, Carbon Copy Cloner, ColorSnapper2, Console, Dash, Discord, Downie 4, EtreCheckPro, Evernote, FastScripts, Firefox, Font Book, GoLand, Google Chrome, HazeOver, Highland 2, IntelliJ IDEA, iTerm, iTunes, Keyboard Maestro, KeyCue, Launchpad, Mactracker, Magnet, Messages, Microsoft Excel, Microsoft Outlook, Microsoft Word, OneDrive, Parallels Toolbox, Paste, Paw, PopChar, PopClip, Preview, Safari, Script Editor, Scrivener, shayre, SnapNDrag Pro, Snappy, SQLPro Studio, SQLPro for SQLite, Terminal, TextSoap, TG Pro, Typinator, Vienna, Visual Studio Code, VLC, WebStorm, Window Tidy, Xcode, Xojo.
So, as soon as devs realize their apps fit in 1GB or something these days where even mid range phones have 4GB of RAM, they see no reason to optimize further.
That made me laugh a bit. Yes, I tend to agree with other criticisms, although in some ways this type of increased resource usage has been going on forever, so I'm not sure it can be laid purely at the feet of hybrid programs:
That's not true. Even with "native binaries" you have the OS as an intermediary.
I recently wasted two weeks starting a new contract at a tier one multi billion dollar orginisation unable to do any work as their standard issue laptop where 8gb window machines and they had no availability of other machines. It took two weeks pointing out we can't do any work, our contractor rates they paying us to do nothing and the approaching deadline to make it way up the chain for senior execs to organise machines with 16gb.
If you need to run Docker with a few containers that's several gigs immediately unavailable to the system. Start MS Teams, another gig, visual studio code / intelij, another gig, a browser another gig or so.
Even without running developer tools on a 8gb machine which seems to be standard issue laptops at most office based companies and average non techy person off the street you very quickly hit the memory limits and swapping to disc as you have a handful of small Electron applications open.
Memory usage is extremely important to users just that most users being non technical don't know it and just think their machine is slow.
Running an application in 2020 with the ubiquitous use of Electron my desktop apps seem less responsive, i can run fewer of them, and any sign of bad internet connection my system comes to a halt as all that apps even if only sending metrics block until api requests are complete or timeout vs running them in the background and not blocking ui functionality.
of course you will need a modern browser, which is everywhere these days.
yes for corner cases Qt/Electron has their place, but I feel 95% GUI these days can be done with Browser + Backend, which is what Electron is doing basically(chromium+nodejs), I just don't want to run browser and electron in parallel, both are memory hungry, so why not just directly browser+backend(in C,golang,nodejs,or whatever)