General Overview of Cross-platform Languages
Developing a cross-platform solution is not a simple process. It requires careful consideration of many aspects that are crucially important for successful product development. In particular, you should pay enough attention to choosing proper cross-platform technology at the beginning; since it is nearly impossible to replace it in your architecture in future.
What is Cross-platform?
A platform is an environment where programming code is executed. There are 2 major types of platforms:
• Hardware: It depends on hardware architecture features, CPU, GPU, etc.
• Software: It depends on the OS, browser or execution runtimes such as Java or .NET.
A cross-platform code is an executable code that runs on different platforms without significant changes.
Let’s combine software platforms into groups:
- Desktop: Windows, Unix, Mac OS
- Browser: Chrome, Firefox, Safari, Opera, IE
- Mobile: Android, iOS, Windows Phone
- Game Console: PlayStation, Xbox, Nintendo
- Server: Unix, Windows Server
- Others: Smart TV, SmartWatch, cameras etc.
Most Popular Cross-platform Languages
Both simple and powerful, Java has become the most popular language according to TIOBE Index 2015. It has a large community as well as a wide choice of different frameworks, libraries, and tools that are mostly open-sourced. The two main execution environments it includes are Java Virtual Machine (UNIX, Windows and Mac OS) and Dalvik (Android).
Java is a great choice for enterprise server-side solutions. It is easy to develop, maintain and scale. Moreover, Java gives you a great way to build Rich Client Applications for desktops (Swing) and Android devices. But it has some drawbacks such as a high level of resource consumption. Due to this reason, it could become very difficult to write code for complex computations with good performance. When development of games or apps for video processing is in question, you need to implement or find modules designed with C++ and integrate them into your Java project.
Using tools like RoboVM, you can write Java code that will be transformed into Objective-C code and work on iOS.
Overall, Java is everywhere, from different kinds of embedded and mobile devices to robots. So, if you want to make a smart TV, navigator, camera, ATM – Java is a good option for you.
C++ gives the best performance for your apps on any platform. It provides direct access to RAM, CPU, GPU and controllers. It is also a base language of complex computations for Game Engines, Video and Image Processing, Big Data Analyses and Processing, etc.
C++ development isn’t as simple as with C# or Java. This is because you cannot concentrate on the business model only, you also need to keep in mind the use and management of allocated resources. So, extra complexity and responsibilities are the main reasons why C++ is not the leading language nowadays. In general, it is used for the performance of critical tasks or low-level hardware programming.
• encapsulation is achieved via closure
• inheritance is object-based but not class-based like in other languages.
C# works in the .NET (Windows) and Mono (UNIX, Mac OS, Android) environments. It doesn’t use Virtual Machine like Java. Cross-platform execution is allowed by compiling C# into Intermediate Language, which is compiled during app runtime into the native code of the execution platform. This allows you to send commands directly to the CPU.
C# is the main competitor of Java. Both languages are very similar, but their frameworks could be very different.
.NET has a lot of nice UI Frameworks (WPF, WinJS) to make a powerful Desktop app for Windows. For UNIX and Mac OS, you can make UI apps using Mono, but you don’t have WPF and WinJS there.
You could run .NET web apps only on Windows Hosting in the past. Windows Hosting is more expensive than the UNIX one. It was a big Java advantage to run apps on any hosting. Microsoft is releasing ASP.NET vNext this year and it is the latest version of their web framework. One of its major features is execution on UNIX servers. Development of web .NET apps is also cross-platform now because Microsoft developed IDE for Linux and Mac OS.
Xamarin Framework allows you to build Android, iOS, and Windows Phone apps. You receive native apps with a very fast development cycle because a major chunk of your code is common or reusable. You can use portable .NET libs, device OS API and different Xamarin components. Both Xamarin community and demand are growing very fast. You can build any kind of app: scheduler, text or photo editor, game, audio and video communicator, etc.
Unity is a cross-platform game engine. It supports iOS, Android, Windows Phone, BlackBerry, Windows, Mac OS, Linux, PS, Xbox, Nintendo and others. It has a web player that works in all major browsers. You can also use Unity for different kinds of 3D modelling software. It is simple and powerful enough, but if you need photorealistic graphics and your game is oriented on PC or Game Consoles, it would be a better option to choose Unreal Engine or CryENGINE.
Silverlight (supported by Microsoft till 2021) is a plugin for desktop browsers, similar to Adobe Flash Flayer. It gives good performance even for games. You can implement some extra capabilities that you can’t make with. If your WPF app is simple enough, you can easily convert it to Silverlight app and launch it in a browser. Like Java, Applets Silverlight doesn`t make the best UX. You receive browser prompts and extra plugin loading time.
With .NET Micro Framework you can build embedded devices, and to do this one only needs basic .NET knowledge.
Universal Windows Platform allows making the single app for a different device with Windows 10: Desktop, Mobile, Xbox, HoloLens, Surface Hub and others. All that is needed to be done is to specify different UX for each device, but software platform features are kept the same.
This article is not a complete guide on how to choose a proper cross-platform solution, but it gives enriching insights by providing a general overview while keeping the software world in focus.
There is a large variety of different platforms. The more platforms you support, the more users you have. But it is hard to find the definite leader of cross-platform languages because technologies develop very fast. A unique feature of one language, framework, platform or technology could be available for other rivals in a few months. Everything valuable becomes a standard soon.