C++ has a long history, beginning in 1979, with Cpre, which added classes to C. By 1980, it was C with Classes. And then in December of 1983, the term C++ was first used, suggested by Rick Mascitti. That's thirty-five years ago this year! Read more in this fascinating article by Bjarne Stroustrup, which also discusses many other aspects of C++’s history. We also recently posted a short history of C++’s various standards ourselves.
My own journey with C++ began much later than 1983. In fact, I was born the same month and year as C++ was named, and at zero years old I was not yet a programmer. I began coding on a BBC microcomputer, followed by Pascal on DOS, followed by Delphi from free cover CDs (our Community Edition is the modern equivalent), Java, C, and PHP. I loved C and learned a lot from it – not least, it was in C I first wrote a parser and evaluator, something I think every programmer should do at least once. But it wasn’t until university that I started using C++, where it was introduced in the standard “this is an output stream, you overload these operators, write a class like this, now you know C++” method that is unfortunately still often the way C++ is taught today.
This did not prepare me for real-world C++.
How should you learn C++? Ignore C, it’s a different language. Start with object-oriented basics, classes vs structs, allocation and then quickly move to templates using unique_ptr as your first, to understand both them and memory management. Then, STL collections, discover function objects in the form of lambdas and move on to iterators and pair those two to understand std::algorithm. Buy a copy of the C++ Primer by Lippmann, Lajoie, and Moo. It’s a big book, but don’t be intimidated, it’s clear and understandable.
I was studying a Computing and an Arts degree, both at the same time, with all the scheduling difficulties you can imagine – the philosophy department did not care much about not overlapping lecture timetables with the computer science department. I hope it’s different today, but expect that it’s much the same: there’s often little value seen, even in a university, in multiple disciplines. After several years I wanted to leave Uni and begin working, so compressed the two degrees into a single Computing degree with a minor in Philosophy – something the Uni was fine with, presumably involving less scheduling.
Books that mix computer science, technology, and philosophy
And then I got a job with a marine science company, for a data analysis and visualisation program written in C++. I was out of my depth. I sat down with a copy of Stroustrup’s The C++ Programming Language and read the entire thing in a week. Then I went to work.
That was the third edition. Today I have the fourth edition on my bookshelf.
Books you should read
Years passed. I learned far more on the job than I did at Uni. I grew to love C++, and like to think that I contributed in some ways to improving that codebase – when I began, they still had parts of it using non-STL, homebrew containers. And we used CVS for source control. I wasn’t the one driving the source control change, but I did replace the last custom containers with STL. I removed OWL and rewrote the UI and app/document structure, this time using C++Builder’s VCL.
But, I introduced some bad code too. When I visited the company a few months ago last time I was in Australia, to say hello to old colleagues, and we discussed a formatted text control used for the dialogs that makes the UI look great but is hard to work with. These days I’d use Markdown
I’m still proud of my part in that software: today, it’s a core part of much marine research and is used by scientists worldwide. It’s written in C++.
More years passed. I moved from Australia to Europe, started a company, wrote more in Delphi after a long absence, wrote IDE plugins for RAD Studio including C++Builder, and eventually ended up as the C++ Product Manager here at Embarcadero. Even after several years, perhaps even more so after several years, I feel it’s an honour to be working among these colleagues, people with such extraordinary expertise and who are all, every one, genuine and kind people, and on such an amazing product, one which itself has so much history. Today, I focus on ensuring we support C++17 and am looking at potential language tooling, among many other things we have on our roadmap. And one constant thread through the past fifteen years has been C++. I learned from it, traveled with it, and I wouldn’t be writing this without it.
I’ll leave you with two really cool things in C++:
C++: happy 35th birthday!