You might be compelled to think of C++ as an old and moldy programming language.
Developed by Bjarne Stroustrup at Bell Labs in 1979, C++ is the foundation for a lot of technology, and a very popular first programming language taught in schools.
Despite the advent of popular object-oriented programming languages like Python, C++ has a dedicated space in the tech world.
In any application that absolutely requires fast machine performance, chances are it’s powered by C++. AAA video games that require advanced graphical capabilities and speeds run on C++. Anything with a GUI tends to be built on C++ (like all the major operating systems and web browsers). Even many operating systems like Linux, iOS, and Android are developed using the C++ programming language.
That’s not to mention the rise of the IoT, embedded systems and resource-heavy VR and AI applications — all of which are usually based on C or C++.
There’s plenty of life in C++ yet. And for a beginning programmer, C++ is one of the smartest first languages to learn.
Ready to get started with C++? This course will get you up to speed.
Why learn C++ in 2019?
Truly understand how computers, compilers and languages work.
C++ is close to the metal — just a few small steps away from assembly code. While other programming languages are built around the business domain, C++ is built around the computer. This gives you a much greater understanding of all the building blocks of programming (useful when you’re starting out).
C++ allows you to learn programming from the ground up. You have to explain everything you do, which gives you a deeper understanding of how all the parts work.
A mastery of C++ will familiarize you with:
- Efficient memory management and pointers — why they’re important and what they do
- Meta-programming — how a program can examine information about itself
- Compile time and load time — the difference between them
- Optimization — what it really means, and how to optimize while you code
- Dynamic libraries — how they really work, and what to do with them
- Generic programming — programs evaluated at compile time
Pick up other languages more easily (if you’re starting here).
Most other major programming languages have syntax based on C++. If you get a good grasp of C++, you’ll be able to pick up other, more verbose languages like Java, far more easily. C++ helps to understand the logic structure of all programming.
It’s actually a lot harder to start with another programming language, and then move to C++. A language like Python, optimized for the way humans think, won’t teach you the way computers think. You may need to re-learn programming from the ground up, if you move to C++.
C++ doesn’t tie you to a specific programming paradigm (like object-oriented programming), so you can easily experiment with different techniques as you learn.
Be a developer that companies want to hire.
There’s a big shortage in the industry.
Not a C++ developer shortage — in fact, there are more developers on the job market these days than ever. Universities and programming bootcamps are churning out developers who specialize in a particular programming language or framework. These devs can jump right into a job tailored to their specialties and start plugging away.
The real shortage is in raw problem solvers. This is what hiring managers are looking for in interviews. This is a skill that no machine or AI can replace (yet).
And C++ teaches you how to be a real, raw problem solver.
One common complaint about learning C++ is that there’s hardly any abstraction in it. You have to define just about every attribute to make the code work. This can result in more complex, lengthy code to write and dig through, unlike more elegant languages like Python.
There’s no garbage collection — you must explicitly mark objects to be deleted. And memory management is done manually. You are in full control. And when something breaks, it’s on you.
This is where the real programming skill is developed. Code runs slow? You’ll need to figure out where the memory is being wasted, and how to dynamically allocate it. Got a bug? You’ll need to roll up your sleeves and search your code. An inconvenience for sure, but one that builds character, and dev cred.
You’ll learn to adopt a more clear and consistent coding style, comment the code as you write it, and learn to limit the visibility of class internals to the outside world — all important facets of object-oriented programming (OOP).
C++ is a very popular language and is utilized by any major tech company like Google, MSFT, and Facebook, so there is a strong demand.
Learn C++ more easily.
As you might have gathered, C++ isn’t the easiest programming language to pick up quickly. The learning curve is pretty steep. But with the right mindset and tools at your disposal, learning C++ can be fun and enriching for any developer. Here are some points to keep in mind as you learn:
Be a problem solver.
Any beginning coder should have a question they ask themselves any time they encounter a new syntax feature to learn:
“What problem does this solve?”
All programming is made to solve problems. By focusing on what problem you are solving with each new thing you learn, you’ll get a much deeper understanding of the language and programming in general.
If you can’t answer the question, there are plenty of resources at your disposal. Did you know C++ questions have the highest answer rate on StackOverflow?
Get acquainted with the latest version of C++.
C++17 is the most recent version of C++, but it’s an incremental update from C++11, the last major upgrade. You’ll definitely want to start there. There are many new features designed to make C++ easier for beginners to pick up, and lots of ways to make your code shorter and easier to read.
Learn with a good teacher, and at your own pace.
Most programmers will agree: a good teacher can spell the difference between mastering C++ as a beginner, and banging your head against a wall. There’s simply no substitute for good instruction.
It’s also important to practice as you learn. You need live C++ code to play with as you learn about it, and the opportunity to move at your own pace.
Our new interactive course C++ Fundamentals: An Interactive Course is the perfect primer to learning C++ from scratch. Start with a simple “Hello, World!” program and learn the basic concepts (conditional statements, loop statements, functions), then learn how classes and templates give you the power to write better code.
With dozens of interactive code challenges and exercises to test your knowledge every step of the way, C++ Fundamentals will give you a comprehensive knowledge of C++ you can apply right away.
Get started today — Check out C++ Fundamentals: An Interactive Course” on Educative.
Any questions? Leave us a comment below!
- — -
Already have some core C++ knowledge? Learn how the C++ Standard Library can simplify your life. C++
Originally published at https://blog.educative.io on January 22, 2019.