Python ML relevance

Started by AlexAres, Nov 01, 2022, 09:34 PM

Previous topic - Next topic

AlexAresTopic starter

As majority knows, Python is the dominance language for ML and AI (connected with data analysis). Some companies imply C++ as an alternative due to the fact it's just faster, however that requires to write ALL operations manually (there are no such amount of libraries for c++). Do you think that would more relevant to design such frameworks for C++?


Key differences between C++ and Python
The main differences between C++ and Python in terms of programming languages are listed below.

Python is an interpreted language. Files with the extension .py does not need to be compiled. You can pass the code directly to the Python interpreter and get the result.

C++ is a compiled language. The compiler creates code from what the programmer wrote, which is then executed to get the result.

C++ has many different functions and a relatively complex syntax. It is not so easy to write code in this language.

Python syntax is very simple, so programs look much simpler and easier to write.

Static/dynamic typing
C++ is a statically typed language. In this way, data types are checked at compile time. Thanks to this, the source code is protected from errors when working.

Python is prone to errors, because the types are checked there already when the program is running.

Get a free trial English lesson
Python is portable. It is also cross-platform, which allows you to run the code on different devices.

C++ is not portable, so the code needs to be compiled specifically for each platform: "I wrote the code once, compile everywhere."

Garbage Collection/Memory Management
In C++, memory needs to be managed manually. There is no automatic garbage collection here.

Python also supports automatic garbage collection. Memory management in it is carried out automatically.