In this article Maxwell Hayes, Daniel and I will attempt to lay out a road-map to learn C++ for people of varying experience levels. We hope to provide good resources and a structure that will help everyone cover each key feature of the language. That way, you can be more confident and make the tools that you imagine.
A Note About Getting Good at Coding
I would like to take a moment to lay out some facts about learning a programming language.
- Every programming language is a little bit different as they are proposed for different technologies and development. As a result, you cannot learn to do everything and I would suggest you focus on what problems you enjoy solving. This way, you will stick with the learning process.
- Good code is an iterative process. Every project you do (even decades in to your career) will teach you something new. This means that you need to learn code by actually coding projects. As you initially learn a language, small console applications will suffice. As you get more confident, meatier projects should be the focus of your attention.
Beginning Your Journey
When you begin learning C++, it is imperative that you commit to three things:
- Learn the basic syntax and structure of the C++ language. Object Oriented Programming, loops, conditional logic, math, functions and some basic algorithms are just a few things you should cover.
- Learn how to debug and search for solutions to errors in C++. Searching StackOverflow, GitHub via search engine is the base “skill” of this. But you should also learn how to place stop points in your IDE (XCode or Visual Studio) and test values by stepping through your code.
- Do some basic projects using these tools and ideas that you learn. As basic projects, these should be primarily terminal based.
Here are some resources that we recommend using. You do not have to use all of them, however, some are more substantial than others. One common thing in programming is that, you will not understand most things until it is explained to you in a number of different ways.
Videos Courses To Type Along With
- C++ Tutorial: Derrick Banas This is well explained and is free. However, Derrick may not have enough time to cover every exception and aspect of the C++ language. However, he does keep his videos up to date with most new features of the language.
- Udemy: The Unreal Engine Developer Course – Learn C++ & Make Games I highly recommend this course if you wish to have broader scope for your C++ development skills besides just audio. If you wish to get into game development and work with larger teams, this entire course is worth your while. Only the first chapter is absolutely necessary (and is entirely console based). The other chapters are more difficult and I would suggest a desktop or beefy laptop as you will actually use Unreal Engine. The explanations of various computer science topics such as v-tables and the like are accurate and well worded. This course is entirely project based (which is good) and will expose you to how to write code for a given standard (in this case Unreal). This means that you are organizing and naming code in a way that is understandable to anyone that uses that framework (a great thing to practice).
- LinkedIn Learning: Become a C++ Developer If you are looking to build a LinkedIn Profile then you may as well start here. Many of these courses cover redundant materials. However, you will likely learn faster as you will have concepts explained in a few different ways. The final couple of videos have more challenging projects such as how to build a string library. For audio, the most important concept is the various videos on Data Structures and memory management (Super important stuff!).
I personally like video courses as you can type along with the tutorials and rewind. I have done each of these recommendations in order to see what was covered. You may want to try more than one of these.
Lastly, I would recommend these sites as references/useful.
- References: tutorialspoint.com, cplusplus.com
- Useful: stackexchange.com, codeproject.com, stackoverflow.com, github.com
Hunger For Knowledge
Congrats! At this point you will have everything you need to start using Juce or taking on larger projects! There are many advanced C++ concepts that you may not have been exposed to but hat is just fine. The main thing is that now you are probably able to problem solve on your own.
Juce is a framework. And our suggestion is that you must learn a framework as its own puzzle. Unreal Engine, Juce, .NET and Qt are all separate frameworks that allow you to put applications together in their own way. They all have their own unique aspects and therefore, you should familiarize yourself with one at a time.
The best way to learn Juce is by going through each tutorial. I know, some of the tutorials are better than others but this will expose you to many ways of using C++ to solve real problems in audio. We also recommend going through the Juce tutorials on the Audio Programmer YouTube channel.
Projects At This Level
After going through the tutorials, you should do projects that you can handle. Here are some ideas:
- A basic Polyphonic synthesizer with presets, save/load, filters, oscillators, mixers and envelopes.
- A basic EQ plugin with by-passable filters and EQ curve visualization.
Gaps In Your Knowledge
What are some other aspects of programming, coding and audio that you should learn? Turns out, quite a few things:
- Concurrency models and thread safety
- UI, UX and GUI development
- Optimizations including SIMD
- Design patterns
- Lock-free data structures vs not lock-free data structures
- Algorithm development and memory management
- Digital Signal Processing (DSP). I have a whole other article on this subject.
Again, you CANNOT learn everything. But you can expose yourself to these ideas over the course of more projects and become more proficient with C++. Also, not all of these ideas are as important to Audio Developers as they are to other types of developers such as Game Developers and the like. Here are links to videos that touch on concepts that we recommend you familiarize yourself with for audio.
- CppCon 2015: Timur Doumler “C++ in the Audio Industry”
- C++ in the Audio Industry, Episode II: Floating Atomics, Timur Doumler, JUCE Summit 2015
- Lock-free programming with modern C++ – Timur Doumler [ACCU 2017]
- CppCon 2014: Herb Sutter “Lock-Free Programming (or, Juggling Razor Blades), Part I”
- CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?”
Miles of Road Ahead!
Congrats! You are probably highly proficient with C++ and are ready to take on more intense projects. Perhaps it is time to make that insane synth you always wanted! Or maybe you are looking to make a cool sample engine! At this point, you could go a number of different ways with C++ as a language. Unfortunately there are very few video courses for specializations with C++ such as audio, parallel computing or game development. However, we would like to leave you with a list of books we recommend for learning C++ and C++ for audio. We will keep these up to date and continue to add more.
- Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14
- C++ Templates: The Complete Guide
- Introduction to Algorithms (The MIT Press)
- Cracking the Coding Interview
- C++ High Performance: Boost and optimize the performance of your C++17 code
You can teach yourself C++. In fact, I taught myself C++ but there are many mistakes and wasted hours and days of effort until I found the resources to guide me in my understanding. Sometimes, I learned aspects “out of order”. Therefore, I hope this list is helpful to those of you on your journey of learning C++.
Be good to each other and take it easy…
-Will ☜(ﾟヮﾟ☜) Daniel ☜(ﾟヮﾟ☜) and (☞ﾟヮﾟ)☞ Maxwell
Will Fehlhaber is an Acoustics Engineer and Audio Programmer from the UK and Bay Area.
Maxwell Hayes is an Audio/DSP Programmer. Musician. Sound Designer. Senior at DigiPen Institute of Technology.
Daniel Walz is a UK based Senior Audio Software Engineer.
- Digital Filter Design: The Analog Prototypes for IIR Filters
- Understanding the Z-Transform Part IV: Analyzing an IIR Filter
- Understanding the Z-Transform III: Analyzing an FIR Filter
- Digital Filter Design: Create an FIR Filter via Windowing
- Understanding the Z-Transform II: Understanding z and the Z-Plot