C++ VS Python

 C++ and python are two different language with different feature and different behavior. Both of these language have one thing in common i.e strong support to object oriented programming.

Key difference between C++ and Python

1) Compilation:  C++ is compiled language, whereas python is interpreted language. As far as speed is concerned C++ run faster then python. 

            Python.                                C++

2)Simplicity: Python with it's simplicity and ease to use feature allow us write concise, easily readable code, etc. This is very useful when we develop complex application like machine learning. Thus Python scores on this parameter especially when we need to choose between C++ and Python for developing Machine learning application.

                Python.                       C++

3)Syntax: In C++ there is demarcation of the code by using block enclosed in {}, semicolon indicating end of statement. Thus in C++ statement are well organized. Whereas in Python there is no blocks or semicolon. Instead python uses indentation.

          Python                               C++

4)Performance: C++ is statically typed language, thus we have fewer error to take care of at runtime. C++ also creates more robust and faster runtime code. This make C++ a language with high performance. Whereas Python being dynamically typed  language have possibility of error or some unwanted situation may arise at runtime. So as far as performance is concerned Python lags behind C++. But when it comes to Machine learning python is one of the upper hand language.

            Python.                               C++.

5) Popularity: Python is easy to learn and easy to put into practice when compared to C++ which becomes harder as we advance to it's feature. Another advantage of Python is it's libraries that allow us to write any functionality especially data analysis and Machine learning, So popularity- wise Python scores over C++. 



So, let's concluded it well, ideally it's up to you as programmer as what to Learn. Secondly it also depends on current requirements. Suppose you want to learn system programming or any such low-level programming I would suggest you to go for C++. If you want some Machine learning knowledge and put in practice, then I would suggest you to go for python.
    Thus it depends on your interest and
requirement to choose a programming language.
    Anyways in programmer's world, it's never enough to know a few programming languages.If you can learn both go head. Good luck.
 




Comments