25
Posted February 24, 2011 by Spyros in C/C++ Programming
 
 

What Should You Choose to Learn ? Python or C++ ?

argument
argument

For those wishing to make a foray into the world of computer programming, C++ makes for one of the best entry level languages to learn. Nearly all American university courses in computing will teach their undergraduates how to program in C++, as it is very user friendly and allows for a more complete freedom of expression and ease of compilation. C++ is an object oriented version of C, one of the first widely used programming languages. Object oriented programming means that instead of telling the computer to work things out for itself, the user creates objects such as strings and arrays and uses the C++ language to manipulate them. For example, instead of writing a long piece of code to store a series of numbers and find the mean, C++ allows the programmer to create a string object, put all the numbers inside it and find the average; a much quicker way of programming.

This functionality, combined with the fact that it works on most platforms (Windows and Apples included), means that it is the market standard for computer game programming and any other application using a Graphical User Interface (GUI). It is very powerful, owing to the availability of hundreds of class libraries. These are separate files to the main program, but allow objects to inherit abilities from other classes. For example, an object set up to run as a clock can inherit the ability to move on one minute after 60 seconds have elapsed without needing to be told to do it every single time. This makes C++ a powerful language to use, as multiple objects can be manipulated to do different things with a minimum amount of code.

These class libraries are also one of its downfalls. Because there are so many, it can become a bit unwieldy, especially when it comes to compiling the code. For a large piece of software, the command line executive could run for up to 100 arguments due to the specificity of each of the class libraries. The class libraries are all produced by different programmers, each of whom will have their own style of coding. This means that adding to or altering the library can be a nightmare, which prompts other programmers to create their own class, which exacerbates the problem. For newbie programmers, the debate always swings between C++ and Python, a more simplistic but less powerful language. Python is the closest thing that modern programming has got to simple English, with each line of code resulting in an action. The language is geared to programmers who want to see things on the screen immediately, while C++ allows users to get a lot done without much to show for it. For the absolute beginner, reading a screen of Python code will make sense, while it will be much harder to work out what’s going on for the same program written in C++.

This was a guest post, thank you !


Spyros