December 17, 2022

Comparing C#, Java and Python

 

All the three lanuages were creaed with attempt to replace the C++ language. It is much easier to write an application with C# and similar languages because no pointers are needed, and there is a large amount of libraries. All of these languages have cons and pros. Let us start with the C# language which has become famous in the Windows community.
C# is the default language in a windows operating system and can be compiled without additional software. The language standard is similar to Java but the syntax is easier to learn and much better documented. The big disadvantage of C# is, that it is not available for Linux. The existing mono ecosystem has to be called a joke because it can't run major components like WPF (GUI widgets) and ADO.net (database access). That means most of the C# programs won't run in Linux. It is pretty hard to create a C# app which runs in windows and Linux as well.
In contrast the java language was created for cross compatibility in mind. The runtime environment in Linux and Windows is the same Similar to C# lots of documentation is available and Java is a mature language. The only problem with java is, that it has never replaced C/C++ because Java programs are known as slow and poorly programmed. For internal projects java is used sometimes.
The third language is Python which has become a surprisingly successful language. Python was started as a scripting language which is around 20x slower than C/C++ code. On the other hand it is very easy to write a software in python and it will run on all major operating systems.
It is hard to say what of these languages is the best one. Perhaps none of them. C# won't run in Linux, Python is too slow, and java can't replace C++. The good news is, that with all these languages it is easy to write software. Even complex programs like games can be created in a few hundred lines of code. It should be mentioned that for unknown reasons none of the presented languages has replaced c/c++. If C and C++ is seen as the same language, more than 80% of the production ready code for windows and Linux is written in the language. In contrast, a language like Java is seen as a toy language without practical value.
From an abstract point of view, it is not possible to invent a pointer free language and use this language for practical application. It seems, that pointer oriented programming is the only way for writing production ready applications. Pointer-oriented means that the abstraction level is lower and the programmer has to decide in detail how to store data in the main memory.

No comments:

Post a Comment