October 21, 2022

Which programming language is the best?

 

There are many attempts available to compare different programming languages each other. In contrast to a famous myth it is possible to determine which language is the best if some prerequisites are fulfilled. First thing to do is to define what “best” means. A possible definition is, that best= high level programming language. The assumption is, that programmers are preferring high level over low level languages. Then it should be defined what a high level language is about. High level means that no pointers are needed, that object orientation is available, that the language is interpreted and very important that a huge libraries with predefined functions is available.
The reason why high level language are preferred over low level language is because it allows to create the same app in a shorter amount of time Writing a hello world gui app will take in pure assembly language around 1 month, in the c language it will take 1 week, in the c# it will take 1 day and in python it can be realized in 10 minutes.
The interesting situation is, that the sorting order from low level to high level language can be measured on an objective basis. Around 99% of the programmer will agree that the following sorting order is correct:
1. assembly language
2. Ansi C
3. C++
4. Java, C#
6. Python, PHP
Low level language are compiled and are using pointers. Midlevel langages like C# doesn't use pointers and there is need to define the datatypes, while high level languages like Python doesn't need anything but the hello world Qt app is created with 5 lines of code and executed on any device and any operating system.
The only question left open is, if high level language are a here to stay or if python has some sort of disadvantages. In most cases the concern is, that high level languages are not great for production systems. Python is known to run slowly, while C# and Java is sometimes called as not snappy enough similar to C++. According to the raw numbers a jit compiler and especially Python like interpreters are much slower than low level languages. And the question is, if such constraints is important or not.
According to the amount of books about high level language and the number of newly created apps, high level languages have replaced low level languages. Most newly created software is not created in Ansi C anymore but in C# and other high level programming languages.Somebody may argue for or against this development but at least it is a fact. The motivation for the individual programmer is mostly to reduce the development time. Instead of programming an app with Ansi C within in 2 years, the idea is to program the same app with a high level language in only half of a year.
In the context of python this sort of programming style is sometimes criticized as creating throw away code. This implies that python code is equal to low quality software. In contrast, a dedicated low level language like Ansi C is labeled as high quality language because it takes much longer until the app is ready.
It is possible to discuss which of the opinion is correct. What we can say for sure is, that all the programing languages can be sorted in a linear chain from low level to high level. High level means, that the same app can be written with less amount of codelines. The result is, that it can be defined precisely if python is more high level than C# or Ansi C.
Python is not the top of the pyramid because there are some languages available which are more high level. GUI RAD builders and especially the MS Access database surpass easily the python language in terms of high level vs low level language. A MS Access database can be created without writing a single line of code. Somebody may ask if such a database has a high quality compared to a program written in C# or even Visual Basic, but at least the fact is, that MS Access is more high level than any programming language.
Another example for ultra high level languages are construction kits and level builder in Games. Here the user doesn't program the game or the app, but is modifying only a level. For example in a level editor for the lemmings game it is possible to draw some obstacles into the screen and after pressing the run button the game gets started. The possible alternative would be to create the game with C++ from scratch which will take for sure months upto years and a deep understanding of the C++ language. With a level builder the same objective can be realized much easier.
A while ago there was a debate at stackoverflow about rewriting an existing PHP webappliation in plain Ansi C.[1] The main argument against such an attempt was, that it will take too much manhours for doing so. Even if the php language runs a bit slower than Ansi C it is the better choice because it is more high level. High level are seen as equal to a good choice because it allows to save time and costs. Even some comments have argued pro C/C++ and the arguments were really good, it is easy to grasp that the stackoverflow post came to the conclusion that PHP is the better langauge for web development over C/C++. Simply because of the fact that only very few or even none web applications are written in C/C++.
[1] https://stackoverflow.com/questions/3079153/why-do-you-not-use-c-for-your-web-apps

No comments:

Post a Comment