C++ vs Python
Tags: computerscience, python, programming, beginners
Published: 2021-04-18 08:31:05



Hello Guys, Welcome back to another post of **Sai Ansul's Blog**.
In this blog we are gonna find which programming language is better.

So let's start,

Firstly let us know what is programming? <br>
Programming is the way we can make the computer perform various tasks.

What is programming language? <br>
It is a formal language to perform various tasks, there are several protocols and algorithms to be followed.

Let us know the types of programming languages:


- Procedural Programming Language. 
- Functional Programming Language. 
- Object-oriented Programming Language. 
- Scripting Programming Language. 
- Logic Programming Language.

Some names of programming language are:
 
- C++ Language. 
- C Language. 
- Pascal Language.
- Python Language.
- Java Language.
- Perl Language
- Lisp Language

So, now lets us know something about both the programming language:

## C++

![White Photo Gaming YouTube Thumbnail.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618658101893/6ORZL3PNI.png)
It is programming language used for building high level programmed applications, developed by Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". C++ supports different ways of programming like: object-oriented, functional, procedural and more.

## Python 
![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618657361352/knijkR4X1.png)
It is a programming language, it's object oriented, it's a interpreter language which is easy to learn. This can be used for software and web development also for data science.

### Now let us know some of the  of the difference between two programming language
<table>
  <tr>
    <th>C++</th>
    <th>Python</th>
  </tr>
  <tr>
    <td>It is statically typed </td>
    <td>It is dynamically typed </td>
  </tr>
  <tr>
    <td>No scope as an backend developer </td>
    <td>Good option for backend developer </td>
  </tr>
  <tr>
    <td> Need to write a lot of lines of code</td>
    <td>Less lines of codes required </td>
  </tr>
  <tr>
    <td>It is pre; compiled</td>
    <td>It uses interpreter</td>
  </tr>
  <tr>
    <td>Looks messy but manageable as compared to python</td>
    <td>It is easy since its object-oriented and simpler to use</td>
  </tr>
  <tr>
    <td>C++ is faster than python  </td>
    <td>Python is slower because it uses interpreter, it also determines on the type of data while running </td>
  </tr>
<tr>
<td> It doesn't support garbage collection </td>
<td> It supports garbage collection </td>
</tr>
<tr>
<td> TIOBE rating is 4 </td>
<td> TIOBE rating is 3 </td>
</tr>
<tr>
<td>Variables are limited within loops </td>
<td> Variables are also accessible outside loops </td>
</tr>
<tr>
<td> Rapid Prototyping not possible because of larger code size</td>
<td> Rapid Prototyping is possible because of the small size of the code</td>
</tr>
<tr>
<td> Not easy in contrast to Python because of its complex syntax. </td>
<td> Program is easier to type </td>
</tr>
</table>
These were some of the differences between these 2 programming language.

### Now let us know some advantage & disadvantages of Python & C++

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1618729828057/Hy85WdYbD.png)
## Advantages of Python
- Its portable
- Its free and open sourced
- Easy to use and fast to develop language
- It has all the libraries that each requires

## Disadvantage of Python 
- Speed is slower than C++
- There are sometimes runtime errors
- Its not a good choice for mobile development
- Its used for functional programming
- Its not a good choice for memory intensive tasks

## Advantages of C++ 
- It is also portable
- Object oriented
- Low-level Manipulation
- Memory Management
 
## Disadvantages of C++
- It does not have any security feature
- It can't support garbage collection
- Difficult to debug while used for web applications
- It becomes complex while in a very big and high level programming

So, since we have covered what is python & C++, its difference and its advantages and disadvantages.

Now lets proceed towards the conclusion

So, if you have read this, you might have a clear idea about which programming language is better and which one you should use.
Python is better beginners because of  its easy code and syntax, its a good for who want to choose their  career  in backend web development.
Python is also leading language for data analytics and machine learning .
But, if you want to develop applications or software then C++ is a good programming language to go for.

Now, at the end you have to decide for what purpose which one you have to choose.