October 27, 2021

Comparison between python and C++

 

There are two important programming languages available which are python and C++. The first one can be programmed much easier but the code is running slow. Python programs in general are around 30x slower than the C++ counter part. The additional problem is that code written in python can't be deployed because the python runtime engine is needed.
On the other hand, C++ is the defacto standard for writing low and high level software. The interesting situation is that both languages are used by today's programmers because they are fulfilling different needs. C++ is an example for a classical programming language. There is need to learn the language first, use a complicated IDE and take care of datatypes, pointers and object oriented features. In contrast to previous languages like pascal or C the C++ standard has simplified programming and can be used to create graphical applications If someone line to create a paint application or to write a game then the C++ language is a here to stay.
But if C++ is the number one language for creating applications and games as well what is the idea of python? The idea behind python is that there is no need for programming but what is created instead is a script. A script is a visual basic like macro which automates something. It doesn't make sense to package a script into a program nor to upload it into the internet, but scripts are locally run modifications to existing software similar to creating an excel spreadsheet. So python is not a programming language but a scripting language.
Basically spoken if someone likes automate something but has no time to write source code than the python language is a here to stay.
Python and C++ are providing a certain perspective. C++ is a language which is oriented on the needs of a computer. Similar to Assembly language or C, C++ makes it easier for a human to communicate with a computer. The programmer doesn't need to know opcodes in hexadecimal notation but he can write down function names and datatypes. With this assumption it is pretty easy to write software.
On the other hand, python is oriented on a problem. It supports problem solving and things like datatypes and pointers are not needed. The interesting situation is that python isn't able to replace c++. Even if python is the more recent approach for programming, python has created many unsolved problems. That means python is only an additional language over C++.
Let us try to criticize C++ a bit. Suppose a programmer has no need for fast running software and he has no need to deploy the code in a production environment. Under such constraints, there is no need to use C++ anymore. The reason why Python has become a wide spread language is because of changing demands. Running a software very fast was only important until the 1990 in which computer power was limited. And deploying production ready code is only needed, if the code should be used a larger audience.
This allows to imagine what the purpose behind Python is. Python is used on fast modern computers in which performance is no longer problem. And it is used to implement prototype software.

No comments:

Post a Comment