Why engineering students “MUST” learn C++ as their first and main language
If you want to find the secrets of the universe think in terms of energy, frequency and vibration ~ Nikola Tesla
The quote above is from one of the men who contributed to technology in no small way, a man I respect so much, he was very liberal with his inventions unlike most of his contemporaries.
Disclaimer 1: This post is meant to serve as a form of motivation and inspiration to students studying engineering or any related course and it’s not intended to castigate or debase any language or non-C/C++ developers.
Disclaimer 2: I do not claim to be a command on C++ but only trying to provide some level of motivation and direction in the little way I can to passionate students (engineering students and/or engineering enthusiasts) feeling lost and needing help on what programming language to learn that would be befitting for their chosen discipline.
Before I start I want to share briefly how and the process that led me into learning C++.
I wasn’t really exposed much to computers while I was growing up as kid (which I wish I was), though I have always loved watching sci-fi movies and technological documentaries even as a kid.
But when I gained admission into the university (FUTO) to study Electrical and Electronic Engineering after my secondary school, I met a couple of brilliant guys, most of them were also in my departments although higher than me in class. One of them, Mubarak Ahmad, then in his final year and also in my department. He is someone you can call a techie and a geek who was as at then building a lot of cool embedded systems projects.
Staying with Mubarak further increased my interest in electronics (embedded systems), he also kept on telling me things about programming, especially Java and C++ and why it is very important I start learning how to code and all that. But despite his advice and persuasions I still refused to learn how to code (I guess I was too scared to start or so). To cut the long story short, after taking Eng 214 (Introduction to Java and C++ Programming or there about) in my sophomore year, I decided to give programming a try. I decided to go for C++ and not Java after making my research. The result of my research then is part of the reasons why I decided to make this post.
In my opinion and experience so far working with programming languages, I can say C++ is the hardest language for students to master or even come to terms with (I know some people will say since it is so then why are you recommending it for us). But as we all know, before gold is extracted, miners have to dig deep into the ground, sometimes they dig even through hard rocks.
C++ is known to be a very powerful language and it gives you a lot of control as to how you use computer resources, so in the right hands it’s speed and ability to cheaply use resources should be able to surpass other languages.
As opposed to C++, which is very difficult to grasp and which makes it’s developers not to only concentrate on the problem to be solved but also on the language syntax and memory management and all the intricacies of the language, programmers using other languages like Java, C#, Javascript e.t.c only need to focus on the problem and allow the language take care of the rest. For instance in Java, the JVM does most of your memory management and garbage collections. In Javascript also, memory are freed automatically when they are no longer in used. In JavaScript you also have freedom of using let, var, no int’s, no double’s, no floats and char pointers at all. “Just store the value somewhere and somehow”. The levels of abstraction allowed programmers to solve their problems faster than before and simultaneously, those levels of abstraction allowed programmers to “know less, do more, don’t worry, make money”.
So learning C++ as your first language (and learning it very well) will afford you the opportunity to:
- Learn and worry about memory management
- Learn how to use pointers which are very important variable declaration, addressing and memory utilization. And which are good for understanding node-based data structures (linked lists, trees, graphs e.t.c).
- Deep dive into generic programming using templates
- Understand how file-systems work in programming
- Worry about and better appreciate the importance of the size of data types
- …and the list goes on….
These and more are the things a student will learn if he/she decides to learn how to code with C++. Also, research and experience has shown that those who learnt C++ as their first language usually do very little work when learning other languages(I think the reason is quite obvious). So mastering C++ guarantees experience to master almost any other programming language.
C and even C++ itself are the root of almost all the highly demanded and sought after modern languages and libraries of today. Here are some typical examples:
- Java: The core of Java Virtual Machine hotspot is implemented in C++.
- C# which is almost a replica of Java from Microsoft has it’s origin traced back to C++ since Java itself was inspired by C++.
- Python: The Python interpreter is implemented in C.
- Javascript: The most popular Javascript engine V8 is implemented in C++.
- Th libuv (Unicorn Velociraptor Library) which is a multi platform C library that provides support for asynchronous I/O based on event loops and primarily designed for only Nodejs gives nodejs it’s powerful I/O capability. This library was built with C/C++.
- The Nodejs, javascript runtime environment used in developing web servers using javascript built with C/C++, and this was the reason behind it’s very high performance and low level access.
- C++ is a system/low level language which is used to build middlewares. C++ as a language has enjoyed so much relevance in the hardware industry as it is one of the highest used languages in developing softwares that power embedded systems (electronics).
- Some other tools like computer drivers, .NET Framework CLR, MS Windows, Java JVM, MongoDB, Redis, web-browsers, Linux, MySQL, (I’m listing random software/tools), Adobe Photoshop, Illustrator, Nginx, OS X is written in a mix of language, but a few important parts are C++, many Google internal/external products (including Google Search), Microsoft Visual Studio, even C# compiler itself is written in C++. (you can find more by googling).
- Most big companies such as Google and Amazon have built their products around the C/C++ language, for example Dart and flutter which were released not long ago by Google as the framework to be used in developing cross platform mobile application was built with C++, the Google search engine was indexed with C++ and a whole lot of other softwares.
- C++ is also highly performant and is used for building video games.
So what am I saying? If you as a student or hobbyist desire to get relevant in the technology world especially in the area of hardware and system engineering, then C++ is a must go for you.
As an engineering student (every engineering specialty), a sound knowledge of C++ is very important for you. I’ll give a brief overview of the importance and what you can do with C++ in some of the engineering disciplines:
- Electrical and Electronic Engineering: Students studying Electrical and Electronic Engineering have a lot to do with C++ as it can be used to program microprocessors and IC’s, carryout signal processing and also to simulate some electrical engineering processes and faults.
- Mechanical Engineering: Students studying Mechanical Engineering can use C/C++ programming to design the various mechanical parts such as knuckle joint, couplings etc as they have to calculate all stresses and determine the dimension, also they need to check them for various failures. C++ shines very well in simulations and hence will be invaluable to mechanical engineers especially those working on roles dependent on simulations.
- Chemical and Petroleum Engineering: Chemical and Petroleum engineers use C/C++ to carry out statistical analysis and developing softwares that will further optimize flow and fluid processing.
- Mechatronic Engineering: This field of engineering is closely related to Electronics and Mechanical Engineering and hence the name, so therefore, they also require C++ for things like writing programs for microprocessors, carrying out analysis, simulations e.t.c.
Also, even if one desires not to use C++ in his/her course of study, the reward is still tremendously much as C++ programmers are quite few and sought after, and they are paid very well. Most big companies in Silicon valley and other parts of the world always look out for programmers who are very good in C++ to work for them either remotely or physically.
So, there are a lot of resources online for newbies interested in learning C++, also the community at stack overflow, github and other online forums are also very active and are always willing to help. Google is your friend!
So at this point I will draw the curtain in order not to bore you all with a very long post.
You can also reach me on twitter @cerntos or email me at ezechris30@gmail.com for further inquiries and recommendations, or you post your questions in the comments.
If you find this post educating and motivating please clap for me and share in order to motivate me to keep writing more of this.