.NET as an alternative to Java

. NET Framework (pronounced Dotnet) is a software runtime created by Microsoft. It originally ran on Windows, but became open source and compatible with Linux. .NET offers a library of functions for graphical interfaces, data access, networks and web applications, compilers and a virtual machine. It allows you to run applications for a regular desktop, as well as Modern UI applications that have WinRT in the backend.

On November 12, 2014, the company announced that it was making .NET open source (under the MIT license) and would now also work on Linux and MacOS. .NET are three different products, all three of which work in C #:

    .NET
  1. Framework, an original that only works on Windows.
  2. .NET Core, a multi-platform version being developed but already suitable for server applications.
  3. Mono, a desktop or mobile version of Android or iOS that gradually shares .NET kernel code.

With the introduction of .NET 5 in 2019, there is only one platform left running on Windows, Linux, Mac, Android and iOS. It replaces the .NET Framework on Windows, .NET Core and Mono and other systems.

.NET ou Java, lequel choisir?

The programmer is primarily interested in choosing a programming language and tools for compiling it, as well as the available APIs for implementing the application. The following languages ​ ​ work on .NET: Ada, Basic , C #,C++, Cobol, Eiffel, Fortran, Haskell, Oberon, PascalPerl, Python, Ruby,, Scheme, SmallTalk. See the full list.

Switching to open source and .NET Core

In April 2014, Microsoft decided to make .NET truly open source and make it under the auspices of an independent foundation - the .NET Foundation. It provides C # and Visual Basic compiler source code for various systems using Microsoft code and Mono code. ASP.NET is also becoming open source. For robotics Micro Framework, will also be managed by the fund and licensed by Apache.

In November 2014, Microsoft itself wears .NET for Linux and Mac OS. This includes the kernel and .NET framework, in addition to the C # ASP.NET and compiler. Runtime, i.e. JIT, is scheduled on GitHub for 2015.
Even Visual Studio becomes free with the Community version.

Why this transition to open source? There will be many advantages to making .NET more open:

In 2015, Microsoft introduced .NET core, a modular architecture to replace the .NET framework (which was actually multiple frameworks depending on system types). This provides a single class library for all device types and is open source. For example, this allows you to implement ASP.NET on Linux.

In 2018, Microsoft announced support for Windows Form, WPF, and UWP XAML in .Net Core 3. This makes .Net Core the successor to the .Net Framework with the advantage that you do not need to install different versions of the Framework depending on the application, as it was.
But this only applies to Windows: Windows Form depends on Windows and cannot be completely ported to Linux or Mac. Windows Forms depends on GDI Plus and WPF DirectX, two graphical bibiliotheces specific to Windows. However, it is envisaged that they will be open.

In May 2019, Microsoft announces the completion of the .NET Framework, which will remain in version 4, and which is being replaced by .NET 5, a unique and versatile version that also replaces .NET Core, Mono, Xamarin. She will also be able to create WebAssembly code.

What is open source in .NET

?

In the diagram below (from Microsoft, translated into French and gray by .fr), open source components are on a color background, and gray contains closed components that only work under Windows.

.NET 2015

Open Source:

Closed:

.NET source code on GitHub.

Standard API

In September 2016, Microsoft announced the creation of a standard API for all .NET platforms: the .NET Framework, originally developed for Windows, .NET Core, an open and portable version, and Mono, a version of Xamarin (now owned by Microsoft) for mobile operating systems except Windows.

This corresponds to the following diagram:

.NET Standard

Developers on the .NET Framework will not need to change their code: WPF or other interfaces remain the same. The new API allows you to expand the capabilities of .NET Core.

Whether to use Java or .NET

?

Do you need to select a Java or .NET environment to create an application? Compatibility and richness of features are key for better choices, but other factors must be considered.

Since November 2008, Java has been licensed under the Open Source, GPL at least partially (this does not apply to the mobile version ).
Several programming languages ​ ​ are transferred to this platform and compiled into bytecode interpreted by JVM. Especially Python and Ruby.

.NET is now run by an independent foundation, and has been as free as Java (which doesn't actually work on mobile devices) since November 2014. There is also a free Visual Studio for creating applications for all systems.

C # is more modern and complete than Java, but no more than Scala + Java library. The focus will be on what the application-specific library offers. The advantage of Java is that older applications work with each new runtime, while .NET applications require an exact version of runtime: you may be required to install several older versions on your computer...

XAML or JavaFX

Mono and .NET had an asset, it was Silverlight, a web technology using a lightweight version of the .NET multiuser, and for which Mono offered a Linux port, Moonlight, which is now abandoned.
But Silverlight does not work in the Modern UI of Windows 8 and is replaced by HTML 5 + JavaScript or XAML + C #. Whether it is XAML or HTML 5, even if the principles are different, it is easy to describe an interface with a declarative language.
For its part, Java has JavaFX, which supports basic development tools (see below).
We can say that both platforms have an effective tool for creating a graphical user interface and increasing performance.

Publishers are more than reluctant to use Modern UI, to the point that the game editor launched its own version of Linux so as not to use it, SteamOS, and manufacturers are considering replacing MUI with Android running on Windows! This second initiative favors Java.

Mono и .NET Core

Mono is a multi-platform version compatible with .NET, originally made by Novell. Following the purchase of Novell by Attachmate, the Mono development team decided to form an independent company, Xamarin. It continues the Mono project and provides commercial versions for major smartphones, including Android and iOS.

Mono is portable: it can run on all UNIX, MacOS and Windows. The advantage of Mono is that you can compile C # into native code under these systems from exactly the same source code, even make games like Unity, which specialized in playing under Mono, shows. They also work on mobile and game consoles.

.NET Core is a new version of the platform launched by Microsoft to create a .NET laptop, especially for use on a Linux server in the Azure cloud service. Therefore, it competes with Mono, but does not provide the same opportunities in 2018. Mono is always required to create an executable file.
Both frameworks use the same Roslyn compiler.

Mono and .NET Core have now been replaced by a single framework, . NET 5.

Mobile phones

Even if you program on your desktop, mobile phones are a factor to consider because it's a plus if you can use your experience in the future on these devices. This is also the area where upcoming developments will be most important

The paid Java virtual machine on mobile devices is being supplanted by Dalvik, an alternative interpreter for Android, and is also being ported to other operating systems .
You can program in C # on Android thanks to the .NET port by Xamarin. This is prejudice language on Windows Phone.
Given the importance of Android, Java is the language that prevails over smartphones. A real alternative here with Objective C from iOS .

In 2014, Microsoft added to Visual Studio .NET Native: the ability to compile source code in binary language, for the Windows Store, so on mobile devices or Windows 8. Thus, the bytecode compiles when the application is first used. This saves space on intermediate language files.

Conclusion

Java has the advantages of seniority: stability, community, documentation, numerous development tools, while .NET offers more openness: almost all languages, new ideas,
In Windows, .NET is saved for applications on the classic desktop, but is replaced by a subset for immersive Modern UI applications. And MUI is a privileged interface for new Windows applications. So if we're looking for universal portability, HTML 5 might actually be the solution.

If you chose .NET, download Visual Studio EDI to create applications.
And if you are indecisive, know that JSC is recompiling .NET assemblies in JavaScript, PHP or Java...

Toolbox

LLILC. MSIL compiler based on LLVM. It is both an alternative to JIT and an AOT compiler .

.NET Components

Programmers running .NET include many systems and components to use.

New components: