Building native apps for Windows: why does it matter?
Why does it matter? All the time techies are inventing something new. Each year you can hear about new revolutionary technologies that are going to change the world. And you think about what you have to do. Should you drop your favorite tool and start learning something new? And of course about web applications development you can hear things like: use web technologies for desktop development instead of proven technologies. And that’s really great because we have to learn something new. But the end should justify the means. Bike to fulfill its main goal – to ride well, and development tools – to create effective and productive applications. But in real life it doesn’t work this way. I can also be influenced by trends, and I am also thinking about what I have to do. When you see different new technologies from Google, Apple, Microsoft, of course, we are under the marketing influence, trends and news. This is why we are trying to change something, to get something new. And that’s why I want to explain why it’s so important to make the right choice for development desktop applications today, especially when talking about native Windows applications.
Each year we get new frameworks, they grow like mushrooms after the rain. Most popular for today are Electron, NW.js, Meteor, and Proton Native. And all these frameworks are based on Node.js. Let’s take Electron as an example. We will look at how it works. Nowadays it’s the most popular and up-to-date framework. I think that if you ask somebody and try to Google such technology, the first thing which you will hear will be Electron. But first I propose to clarify what is and how it works and why all these frameworks are based on Node.js. Maybe all these frameworks just came after Node.js was developed and introduced?
Now about the cons. Performance matters of course. Applications will need more calculation resources, especially memory. You know that in our world sometimes instead of development effective applications we just don’t think about such things. We think that our computers are becoming faster and faster, and the cost of development time is much higher than our computing resources time. During maybe last 10 years, the calculation resources of our computers have increased ten or maybe fifty or hundred times! But finally we have the same applications. And, finally, with Electron we don’t have native application for Windows, nor do we have native UI. We have V8 bytecode for execution inside the V8 engine. Maybe it’s only my fears, but what will we have in the future? Maybe these revolutionary technologies will be stopped and support will be stopped?
Also you will depend on Chromium and its updates and compatibility of V8 engine with Chromium, and it’s not an easy question. Github community should keep it up-to-date. Not all enterprise developers are ready to use open source solutions. Also you have to think about source code protection issue. And that’s what I hear from different developers, and it’s not only my opinion, you can google Stack Overflow most popular questions about Electron and check all these cons which people are talking about. And one of the interesting things is that when you’re distributing your application, your package will always have a lot of extra resources. I even heard that desktop application can have a lot of modules which belong to mobile application, and your app will “eat” your computing resources.
Now let’s return to RAD Studio. We have the best performance for VCL and FMX because of low-level execution without any packages. In the end we have binary which is ready-to-use machine code which can be executed immediately. It’s a really proven tool for Windows desktop development. We don’t have any dependencies and layers like Chromium for UI or Node.js for execution. We have everything that we need. We have a small executable size and low memory use. And of course we will have native applications for Windows.
Interesting but if you want to try Electron and at the same time you like Delphi, I can tell you a little secret: you can develop an Electron application using your favorite tool. This solution is called TMS WEB Core.
I had no other choice. I have created my own three applications to have an example. They have the same functionality because I wanted to compare these three not even technologies but three different frameworks and tools combinations. The first one is Delphi. Delphi VCL application with Object Pascal. The second one is a recommended environment for development native Electron applications. I’m not talking about native applications from Windows, I’m talking about native tools for developing Electron applications. The third example is Delphi with TMS WEB Core.
I just created three Windows applications: Electron, TMS WEB Core and Delphi. What I can see is that Electron native application and Delphi and TMS WEB Core applications are the same. I mean that using TMS WEB Core you can create the same application like with native Electron development tools. Under the hood they are working similarly. Our VCL application is using the same resources, for Electron we have three processes, CPU is the same, but memory is increasing, I don’t know why. In this case I can say that TMS WEB Core and native Electron tools are almost the same, you can use Delphi to write Electron applications. As for the memory you can see that memory is increasing. And again maybe my benchmark was not very correct but let’s suggest the experience of Electron people to provide their benchmarks.
Well, let’s compare Delphi VCL, FireMonkey. VCL is only for Windows, win32 and win64 applications, and FireMonkey is a cross-platform framework with different number of classes inside Delphi. For Windows desktop development from Microsoft we have WinForms and WPF, and let’s compare these two technologies with Delphi. If we talking about WinForms, it is really the first developer-friendly framework for Windows after Visual Studio 6 it was a 2003 version when the C# and .NET were introduced and for me it is just a little copy of Delphi. The concept was very similar. WinForms UI capabilities for apps are still too weak, it’s too hard to customize UI controls. For today I don’t know people who start new development using WinForms, it seems to be an almost obsolete framework. I think that Delphi and VCL are really more developer-friendly tool for building rich UI applications. It really has a huge set of UI components for building rich UI including native Windows applications and Windows 10 applications, it’s really up-to-date. But of course the world is changing and if you need something newer and more universal, with cross-platform capabilities, you can try FMX.
If we are talking about WPF technology from Microsoft, it is a really flexible and deep customizable framework if compared with their WinForms, it’s very adaptable for building rich UI applications for Windows. But as for me WPF sometimes is not trivial for developing rich UI apps using XAML. And it has to work faster but not on the obsolete computers. We need brand new computers. If compared with Delphi and VCL, I think it will be more correct to compare WPF with FMX, because FMX has its own and new generation framework for building applications, because we have a new style-based development ideology for styling our applications. This is why I think that WPF is a little bit above VCL, but FMX is on the same layer.
If I already said about FMX, let’s say a couple of words about VCL and FMX. If we’re talking about VCL, we still can use it and use it for a brand-new development because it has deep Windows OS integration including Windows 10. And it is only for Windows for today and it will be in the future. It has a huge 3rd-party components availability especially for Windows. If we think about cross-platform or we have some requirements, maybe in the future we will have something multi-platform, theoretically, we can start from VCL and then just migrate VCL to FMX. Most of the migration tasks will be in the field of migration of user interface, because FMX has totally different components, structure, and ideology. But if we choose FMX for brand new development, we will really have a Windows native application with a single codebase and future possibility of adding support for Linux and MacOS, because for FMX it is building the same native application as for VCL. You’re compiling your application to a low-level machine code, again, as I already said, FMX has a new GUI concept based on styles. I think it’s very interesting, and you can even try and check FMX samples from the GetIT package manager and check how they work. Each cross-platform technology has its limitations, and, as I said, in the end you will have the same executive as for VCL. The decision is up to you, you can check and you can think.
This is why RAD Studio, Delphi and C++ Builder come in as an original Rapid Application Development solution today. Using Delphi developers really get maximum productivity, get native desktop performance with less overhead, and access to all platform features without any limitations, additions, and so on. But if multi-platform is a requirement for you, then you can try FireMonkey framework which will give you desktop application compatibility on Windows, Mac OS, and Linux, with the options to extend them to Android and iOS.