Skip to main content

Why C++, when python is much easier?

Python is the easiest programming language to date because its syntax is simple to learn and understand, but why is there a need to learn C++?

C++ is a mid-level language as it was developed in 1979 after C. C++ is an extended version of C, where '++' is an increment.  C++, being close to the hardware of the computer, is irreplaceable. It is highly in demand than any other language. You don't need to learn C if you want to learn C++. You can understand the architecture of the computer hardware. It is the most widely used language for game development, applications development, and rendering engines.


Programming Languages
Languages-Pixabay



Python can be used like an object-oriented language but C++ is much more versatile and powerful. Moreover, the main thing which matters is the logic of the program. The logic in both of these languages depends upon the programmer.

Let's see the difference between the languages with an example.
Python
Python-Pixabay

Writing Hello World! Program in Python:


print ('Hello World!')
C++
C++ -Pixabay

Writing Hello World! program in C++:

1- #include <iostream>
2- using namespace std;
3- void main ()
4- {
5-          cout<<"Hello World!";
6- }

In python, we just give the command to the computer without understanding the main process the computer has to do.

Whereas, in C++ we include library functions and header files to understand the main working of the computer. If we haven't included the first two lines in the program, we would have been met with an error. iostream is a library having the compile command. Std is a standard function of taking the input and displaying the output. If we skip the 2nd line of the program, we would have written std::cout instead of cout only, to avoid errors.

C++ provides better job opportunities and high salary. Its main quality is that it's irreplaceable so that the most popular and heavy sites like Facebook, Amazon, Adobe, and Autodesk are C++ centric products.

C++ can be hard and cannot be learned in a day. On the other hand, python is way too easy and its syntax can be learned in minutes. Python may work in situations where C++ is hard.

I recommend learning C++ because when you learn this particular language, python can be learned in minutes if you need to learn. Logic depends upon the user but the thing which differentiates any language from another language is its syntax.

That's all folks. Feel free to comment.



Comments

Post a Comment

Popular posts from this blog

CEME NUST, another aspect of story....

    There has been a rise in the controversy that the students of the College of Electrical and Mechanical Engineering, NUST are not treated nicely. However, I can assure that there is no other institution in Pakistan which can provide a healthy and grooming environment for the freshmen. They may provide you the advanced technology labs and buildings, but as a matter of fact, they will not train you for your better tomorrow as CEME does.      I am a student of CEME, and most importantly the most junior DE-40 in the CEME. I am against any of the rumors trying to damage the reputation of CEME, NUST. We are taught to be better persons for our society, we are taught to speak in front of public, we are taught to take responsibilities, we are taught to deal with the things calmly, we are taught to respect our elders and peers, we are taught to make decision quickly and precisely, we are taught to lead our life in a disciplined way.     As far as tha...

C++ Program for solving 2nd equatiion of motion (Kinematics)

As we know the 2nd equation of motion   #include<iostream> #include<cmath> using namespace std; void main() { double vi, vf, a, s; int eq; cout << "Press 1 to solve for acceleration, 2 for distance, 3 for initial velocity and 4 for final velocity \n"; cin >> eq; if (eq == 1) { cout << "Enter vf, vi and s \n"; cin >> vf >> vi >> s; a = (pow(vf, 2) - pow(vi, 2)) / (2 * s); cout << "Acceleration is " << a << endl; } else if (eq == 2) { cout << "Enter vf, vi and a \n"; cin >> vf >> vi >> a; s = (pow(vf, 2) - pow(vi, 2)) / (2 * a); cout << "Distance is " << s << endl; } else if (eq == 3) { cout << "Enter vf, s and a \n"; cin >> vf >> s >> a; vi = sqrt(pow(vf, 2) - 2 * a*s); cout << "Initial velocity is " <...