September 06, 2019

Is Microsoft dotnet the future?


The C# language and the Java language are both potential alternatives to the well known C++ standard. What makes them unique is, that the code is executed in a virtual machine. The advantage is, that for the programmer it's easier to create the sourcecode, because the VM interprets the program in realtime and for the compiler writers, it's easier to create the VM over a dedicated compiler like the G++ compiler.
In case of the Java ecosystem the problem is, that after a while the language has become unrealiable. The recent updates are given under a different license, and it's unclear who exactly develops Java further. The situation in C# and dotnot is the oppposite. Dotnet is for the Windows ecosystem a quasi standard and every programmer is forced to use the platform.
The interesting point is, that for the Linux platform, no such development like dotnet was invented. Instead, the gnome desktop is trying to standardize the programming API a bit, but in general not very successful. The GTK+ library was written in C, but it's also possible to use the C++ language to get access to gnome. A unique programming interface comparable to C# is missing for Linux.
On the other hand, Microsoft is motivated to port the dortnet software to the Linux operating system as well. Under the term “Mono project” it was made possible to run C# code under Linux, https://www.mono-project.com/docs/advanced/runtime/ Does this make sense? It's unclear right now. On the first look, it's a bad idea to combine C# with an opensource operating system. On the other hand, Linux has a demand for a dotnet like architecture. Is dotnet something which will finds it way from Microsoft to Linux in the future?
Let us first imagine the other way around. What can Windows programmers learn from Linux users in developing object oriented software? The surprising answer is, that they can't learn anything, because programming under Windows is more comfortable than under Linux. In contrast to the Gnome ecosystem, under Windows the programmer gets a standardized ecosystem which has only one way in painting windows. And he is not forced to learn outdated c libraries or handle with C++ pointers. The main reason why C# was invented during the year 2000 was to avoid the chaotic situation in which the programmer is forced to program with C++. That means, Windows has made the next logical step to an interpreted environment, while under Linux the situation is chaotic.
Programming under a Linux operating system with the C compiler is only comfortable if the idea is to create console applications. In this use case, Windows has no advantage over Linux. In both cases, the programmer types in C like code syntax into the editor and after pressing the compile button, he gets the working application. Only in the case of creating desktop applications, Linux provides no help for the programmer. That's the reason why the amount of GUI programs for Linux is low and the market share of the Linux desktop too.
On the other hand, Microsoft has solved the Desktop programming issue very well. Their dotnet strategy is a here to stay, and gets developed further in the future. From a technical point of view it make sense to ask if the Linux community can learn from Microsoft how to program software in C#.
Before it's possible to judge about C# and the mono project we have to ask why the C# language was introduced under the Windows operating system. The goal is twofold. First, there was a needed for object-oriented programming in a virtual machine. The advantage over C++ is, that programming is much easier because the programmer can focus on the application but not on the internals of a computer. C# is comparable to the Python language, but can be used for creating productive code as well. The second reason why dotnet was introduced was, to provide a GUI API for creating desktop applications. The programmer gets predefined routines for drawing windows and programming games.
Now we can investigate if Linux programmer have the same needs. The first question is, if a Linux user needs to program an application with an object oriented language which is not C++, and the second question is if he needs a standardized GUI API. In both cases the answer is yes. Because the Linux desktop is similar to the Windows desktop a graphical environment and object oriented programming is the natural way in creating software. The alternative over the Mono project would be to use Python (which is technically a scripting language, but not a virtual machine) or to use the Java language (which had become some problems in the recent years).
A possible alternative over using mono and dotnet is, if the Linux community would develop it's own managed GUI API. It would be combination of Gnome, C++ and Wayland. The prediction is, that this kind of technology will not be realized. Because the market is too small. Red Hat would be the only vendor who is able to invent a new API on top of the Gnome desktop and combine this with a programming language. It's unclear, if they are plan to do so.
The reason for the missing Linux desktop environment is, that the user base who is using the Linux desktop is smaller than 1 million worldwide, while in contrast around 3 billion people worldwide are familiar with the Windows desktop. That means, GUI programming under a desktop operating system is equal to write C# code. And Linux is not able to convince the world, that they doesn't need desktop applications. The main problem with the Linux os is, that the focus of interest is located on the command line. The perfect Linux computer is a headless one, which runs the apache Webserver plus kernel drivers for accessing the network card. The desktop environment was put on top of the X11 display server and the amount of effort into this domain is small.
Even the largest Linux GUI framework, called Gnome, has a very small programming community. The amount of documentation is little and the existing API doesn't make much sense. Creating a GUI Application under Linux is some kind of adventure, which means that it's an unexplored journey. The problem is, that there are around 300 different GUI frameworks which can be used by lots of programming languages like TCL, C and python but there is no best practice method in writing a mainstream Linux application.