Hello readers! I’m back for third edition of Programming for N00bz. This week we are going to cover another widely used programming language here on campus and in industry, C++.
C++ was originally designed as an upgrade to C, but eventually became the completely separate programming language that we know today. As a result, C++ is completely backwards compatible with all features that are included in C, such as dynamic memory allocation and the ability to program at a very low level in the computer.
However, C++ adds Object Oriented Programming (OOP), which allows the programmer to represent various components of a program as objects which can be modeled after real life objects. It also features improved methods of handling errors in the code, the ability to assign context sensitive functions to operators (+, -, >, etc.) and a whole slew of libraries that contain pre-built templates for data structures. There are also some improvements to the syntax that make C++ code easier to read and comment (add non-code explanations to what the program does) when compared to that scary mess I showed you in last week’s column.
So now that we’ve covered some of the new features added to C++, who exactly uses C++ at the University of Waterloo? In first year, Software, Systems Design, Mechatronics and Mechanical Engineers take courses that are taught exclusively in C++, with Mechanical engineers also learning Robot C which is very similar syntactically. In upper years, Electrical and Computer Engineers, and almost all students in computer science-related majors, use C++ extensively.
In industry, C++ is one of the most widely used programming languages, with almost every large tech company (Google, Facebook, Amazon etc.) putting it as a requirement on a majority of job applications. Moreover, almost all games on your computer or video game console are primarily programmed in C++ and knowing C++ is the easiest way to become a video game programmer.
C++ use is widespread partly because of the backward compatibility with C. Most graphics engines and large-scale programs require many lower level components (working with hardware instead of the operating system). Since C++ has the low-level abilities of C and the higher-level abilities that languages such as Java and Python offer, it is a natural choice when building a program that contains both high- and low-level components.
In a more physical sense, languages derived from C++ are used to program many microcontrollers used to build robots and other mechanical and robotic systems. This is probably the primary reason that Mechanical and Mechatronics Engineers learn C++ and luckily the applications are visible in their programming courses.
So the last question is why would someone who doesn’t have a programming related job or major learn C++. Other than the robotic and mechanical applications with microcontrollers there isn’t much incentive except interest. However, if you ever want to learn programming for hobby or career purposes I highly recommend picking C++ as a starting point because of its versatility.
To conclude, C++ is a widely used, versatile programming language that combines the low-level applications of C and the higher-level abilities of more modern languages into an extremely dynamic package. It is widely used in the university and in industry while serving as the backbone for many of the programs that you use on a daily basis.
That wraps up this week’s column. Next week’s column is the last for the term and its language will be a pleasant surprise.
Leave a Reply