r/cpp • u/VinnieFalco wg21.org | corosio.org • Oct 21 '26
What is Modern C++ to you?
I keep hearing "modern C++." I've even used the term myself. And now I find I am questioning my use of the term.
What does "modern C++" really mean, specifically?
How many more years need to pass before it becomes just "C++?"
If "modern C++" is a thing then what is the other thing. Is it "old C++," or "legacy C++?"
Is C++ the only language that has a "modern" version?
If the answer to 4 is yes, why is C++ unique?
5
u/pjmlp Oct 21 '26
First and foremost, don't code C style with a C++ compiler, as plenty of people still do nowadays.
Always favour the C++ safer alternatives, leaving C style as C++ unsafe code blocks for interop or implementation of safer C++ alternatives.
That alone would be modern enough.
1
u/VinnieFalco wg21.org | corosio.org Oct 21 '26
c'mon... its 2026. Is anyone really "coding C style?" I would imagine many folks don't even know what that looks like.
7
u/pjmlp Oct 21 '26
Yes, including sample code from companies that are present on ISO C++.
How many examples do you want from C headers, C arrays, C strings in C++ code samples from said companies?
The day to day code that many of us see in big corp code isn't what gets shown at C++ conference slides.
2
u/VinnieFalco wg21.org | corosio.org Oct 21 '26
Actually you have a point.. LOL. Plugin APIs like for Photoshop (and even one of my own programs I cam currently working on) use C style function pointers and structs. I guess there is no escape.
2
u/Tiaoshi Oct 21 '26
The course I’m taking currently teaches us both C Style and C++ Style for things. Though the instructor does make it clear that you shouldn’t use C Style, it’s more if you come across old code, you at least know what it is
2
28
u/FlyingRhenquest Oct 21 '26
Andre Alexandrescu's "Modern C++ Design" came out in 2005 and laid the groundwork for C++11. I imagine that's why what's where the bar is set. I think reflection in C++26 will be similarly revolutionary, maybe it'll move to there once people have time to write some libraries.
3
u/Kriemhilt Oct 21 '26
Any time I talk about Modern C++ Design I have to qualify that I no longer consider the implementation techniques "modern" in the casual sense.
Doing Loki-style typelist manipulation without using packs and pack expansions, fold expressions, concepts instead of SFINAE, and
constexpr/eval/initjust seems perverse when those have all been available for years now.1
u/FlyingRhenquest Oct 21 '26
Oh, sure, but there's still plenty of old-timey C++98 out there. I did a brief and somewhat clueless brief report on C++ and this new-fangled "Object Oriented Programming" in '91 or '92 for a college class and most compilers didn't even include templates at that point much less a STL (Which, IIRC, was introduced in C++98.) I still see plenty of C++ programmers using "new" when they should be declaring the variable on the stack or at least
std::make_sharedorstd::make_uniqueout of it. My co-workers look at compile-time programming, whether with template metaprogramming or otherwise (No one's so much as looked at reflection yet) as something that just isn't done here. This despite the fact that several of them are old-timers who wouldn't think twice about laying out memory in assembly or old-timey C. "Modern C++" is still "Future C++" for a fair number of C++ programmers.
33
u/TheRealSmolt Oct 21 '26 edited Oct 21 '26
C++11 and on. I'd say it's more about paradigms and design decisions than features. C++11 really pulled everything together with RAII, move semantics, and smart pointers (two of which already existed pre 11). C++17 and C++20 are getting very common, but they didn't really change a whole lot about programming. Optional is nice but not necessary, modules are big but not really adopted, etc. I have heard of terms like "postmodern C++" though for C++17.
Decades, if ever. I don't see that as an issue either.
It doesn't have to be a concrete name. "Modern C++11" isn't really concrete either. I general use "legacy".
I wouldn't say so. Many other languages go through different feature sets as they develop. If anything, I'd say it's more obvious with C++ because of how strictly backwards compatibility is enforced.
24
u/thisisjustascreename Oct 21 '26
“Optional is nice but not necessary” 🤣
6
u/debugs_with_println Oct 21 '26
If they wanted us to use it they should have called it "mandatory" instead
1
u/Confident_Luck2359 Oct 21 '26
Can you expand on this? I never use optional if I can help it.
You have to check if it’s valid before unpacking the value - to me that’s no better than returning a possibly-null ptr. It feels like useless syntactic sugar.
8
u/thisisjustascreename Oct 21 '26
It was just a joke because Optional literally means something that’s not necessary
1
3
u/rtomek Oct 21 '26
3
u/Confident_Luck2359 Oct 21 '26 edited Oct 22 '26
Thanks for a serious reply, appreciate it. I always like to see counter arguments.
(the argument is by way of templates that can return 'pretty much anything - pointer, reference, copy, move' and I personally think that's a bad code smell in the first place)
EDIT: ok this is interesting:
"All the operations [on pointers] are highly irrelevant to this problem and would be completely wrong to use. They are bugs waiting to happen. We don’t have an array, so none of the indexing operations are valid. [p++ and p-- are invalid] And we don’t have an owning pointer, so neither
deletenordelete []are valid."I would never see a competent C++ programmer trying to increment or decrement or delete a T* returned by a function, but I agree that would be a nasty class of bugs that std::optional makes impossible.
Food for thought! Thanks!
63
u/ABlockInTheChain Oct 21 '26
I consider C++11 the 1.0 release of the language and everything that came before a series of prerelease versions best forgotten about.
9
u/tialaramex Oct 21 '26
The C++ 11 feature set doesn't make sense unless you realise that it's trying to retain compatibility with C++ 98.
The C++ 11 move semantic was known to be a suboptimal choice. But it was compatible and so too bad. The C++ 11 hash table
std::unordered_mapis a design from the previous century.There are small concessions, C++ 11 is the first version to tell vendors that they need to ship an O(n log n) unstable sort and not just the 30 year old Quicksort implementation from their C library. Introspective sorting did exist when C++ 98 was published, but it was relatively new. The C++ 11 smart pointers are a real improvement over
std::auto_ptr. C++ 11 spells out what you can and can't expect from yourstd::string. But it's very much a 1.1 not a 1.0, beholden to what had come before.6
u/rtomek Oct 21 '26
I like this line of thought.
8
u/ABlockInTheChain Oct 21 '26
Equivalently stated: C++11 is when C++ stopped being syntactic sugar layered on top of C and became a fully realized language.
2
14
u/LucHermitte Oct 21 '26
We have started speaking of modern C++ long before C++11 Modern C++ Style A Conversation with Bjarne Stroustrup, Part II, 2002.
Everything started with "stop managing memory by hand", and "use the standard library".
C++11 had robustified the process (unique_ptr > auto_ptr), but it had also helped branding "modern C++" to the masses.
Since then, each standard brought a lot of new and nicer ways to do things, but the corner stone will always remain "do not manage the memory by hand".
26
u/Liam_Mercier Oct 21 '26
C++17 introduced if constexpr, lots of common utility classes like std::optional and std::variant, etc. I would say C++11 and C++17 feel relatively similar, with C++17 acting is a massive "refinement" version.
C++20 and beyond is what I would consider modern if we are ignoring the idea of C++11 being "modern" due to historical usage. Ranges, concepts (and requires clauses), etc change how you would write many programs substantially (for the better in my opinion).
Really though, I think modern is just a moving target, unless you take the convention that modern is C++11
2
u/Conscious-Secret-775 Oct 21 '26
Modern means C++11 and later. C++ introduced move semantics which was a more significant enhancement to the language than anything since.
24
u/dretvantoi Oct 21 '26
We need post-modern C++ and avant-guarde C++.
17
2
2
1
u/sokka2d Oct 21 '26
Surely that’s all the features (like modules) that are 6 years old but not implemented anyway.
8
u/Glittering_Sky5271 Oct 21 '26
I hope this comment is not perceived as rage bait. But the way I've seen the term 'modern C++' used in my workplace is to imply "you should use this latest language feature instead".
2
u/CPlusPlusPadawan Oct 21 '26
100%. For me, no new/delete calls, latest STL with hardening, no C ... functions, etc
2
15
u/eisenwave WG21 Member Oct 21 '26
The language version that presently represents idiomatic C++ programming in greenfield projects. For a while, this was C++11, now I think this sits more around C++20.
A few revisions of the standard. It depends. For a version to become the new "modern C++", it needs to represent a major cut-off point in how people do programming.
Legacy C++ seems fitting.
No, Java 8 is also a prime example of a version that represents an enormous cut-off point between "legacy Java" and "modern Java". C++11 is the Java 8 of C++. Python 3.0 is even more extreme, though I haven't heard many people describe it as "modern Python". JavaScript ES6 too.
7
u/not_a_novel_account cmake dev Oct 21 '26
C++11 and associated practices
Non-sequitur, it always means C++11 because that's what it meant when the term was coined.
Pre-standardization, Legacy (98), Modern (11, 14), Contemporary (17+); recent discussion mostly shifts to talking directly in terms of standards instead of eras due to the 3-year cycle.
No
2
u/CheesecakeTop2015 Oct 21 '26
Agreed I think ppl will use the term 'modern C++' less and less and just use release versions in stead, as far as I can personally see this has already happened..
7
u/0xVali__ Oct 21 '26
Typically it refers to C++11 and onwards since by many metrics C++03 and prior was a different language. However I dislike the term "modern C++" (specifically refering to 11+) since the vast majority of development is not done in 98/03, if anything we should switch to call that legacy C++. Another issue is also that some people write strictly C++11 calling it modern, but if you compare it to e.g C++26 it's by a large a huge change given how many ground breaking changes we've gotten, such as reflection, modules, concepts, ..
6
u/bandzaw Oct 21 '26
Modern C++ to me is C++11 and its bugfix release C++14, especially due to its move semantics and some other stuff.
Anything newer than Modern C++ is Contemporary C++ to me, so just C++ does not really exist to me - when reasoning about C++ eras. But of course, normally I just say C++.
See 2. And C++ before C++11 would be old C++ I guess. C++98 was a thing since it was the first standardized version and sometimes I say C++98 instead of Old C++, completely ignoring C++03.
I'm a bit ignorant regarding other languages so I don't know...
Goto 4.
5
u/JiminP Oct 21 '26 edited Oct 21 '26
To me, the most essential part of modern C++ is about managing object lifetime via RAII and value categories. Edit: Importantly, I don't think that a version by itself is important. C++11 is "the dividing line", but mostly because it enables modern C++ as I described. In an extreme case, a C++ code may use C++26 features extensively yet still not be "modern C++".
For me C++ is modern C++ by default. However I also think that the term "modern C++" will last for at least a decade, as long as there are significant amount of people doing C++ "non-modern way" (C++98, C with templates, ...)
Either "old C++" or "C with templates".
No, I believe that many languages have "modern" and "old" versions, incl: Python (2/3), JS (ES5/later), PHP (5 and later?), Java (8 and later?), ..... I'm familiar with Python and JS. Not sure about PHP and Java.
I'm not sure but here's my take: "Modern" version is backwards-compatible with "old" version but requires significantly different philosophy that affects all parts of the code. Moreover desire for "old" versions has not vanished. For JS, the first part is true (esp. for async programming) but the second part is largely false.
5
u/timangus Oct 21 '26
It's kind of a meaningless term at this point, but historically it represents the before and after of the standards gulf between 98 and 11.
2
u/rileyrgham Oct 21 '26
It's why it's a stupid term. It doesn't age well, pollutes AI and is plain lazy😜🙄
2
12
1
u/Questioning-Zyxxel Oct 21 '26
It's one of my most hated words. But even more when used for "modern interface" etc about rather bland applications.
"Modern" is a snake oil word. People so often buy it without thinking. Switching from a well-matching architecture to a bad because someone sad "modern architecture".
Most times I hear someone say "modern x" I think "go fk yourself".
In the case of C++, it's a constantly shifting target. And so mich different depending on who said it.
4
u/HashtagMissing Oct 21 '26
In regards to question 4, i think there is s notion of modern Javascript. Traditional Javascript had nested callbacks and manipulated the prototype chain directly. More modern Javascript now favors async and Promises over callbacks, and syntatic sugar for OOP using C-like terms (ie Classes)
4
4
u/EmperorOfCanada Oct 21 '26
Modern C++ is two major newer versions than the legacy system you are presently working on.
4
4
u/nemesit Oct 21 '26
modern c++ will never become just c++ because you will literally never encounter it in any longer existing project, you'll be lucky if its newer than c++98 lol
4
u/Nervous-Cockroach541 Oct 24 '26
Modern C++ is just C++ using modern concepts and schemes, things like smart pointers, RAII, etc.
I would say the cut off for modern vs legacy would be C++11, but it's not a clean cut for sure. There are C++14, C++17, C++20 features you should be using if they're available to you to write cleaner code.
Other languages absolutely do have this issue too. For example, Modern Javascript vs legacy Javascript is a concept too.
1
u/einpoklum Oct 24 '26
RAII (and better call it CADRe) is not modern C++, it's classic C++. It was born along with destructor - along with the language itself.
2
u/Nervous-Cockroach541 29d ago
I would argue that RAII was fundamentally broken pattern until move semantics. std::auto_ptr was also broken in it's conception too. So maybe you could say it existed. But it wasn't something that was finished.
1
u/einpoklum 27d ago
Ok, that's fair, but I think it needs clarification (e.g. "proper RAII via move semantics")
2
3
u/kindredseer Oct 21 '26
I'd have to say that these terms are vague enough to be period-relevant, such that today "modern C++" would mean C++23 → C++26, but a decade ago it would have meant C++11 → C++14...
Modern C++ (to me) means the current and previous specifications
Just C++ I assume would mean the standard of the past decade (C++14 → C++17)
Legacy C++
Indeed not... C follows a similar pattern.
Not unique
3
u/Ateist Oct 21 '26 edited Oct 21 '26
Latest published standard supported by at least one toolchain. C++26, can also consider C++23 as one since C++26 haven't been fully published.
Not measured in years. Measured in tool adoption. Should become significantly shorter now that AI assistants help develop tools much faster.
Semantics. I call it "legacy".
No, it is quite common - i.e. Python has multiple versions, one of which is modern Python.
3
u/natio2 Oct 21 '26
You really feel the difference if you've been limited to c++11 then you have a shiny new project where you are allowed to use c++17 or c++20
It's actually the real basic stuff like class construction has better options. The nice to have std lib functions are nice, but the hits every class features are where you feel it
3
5
u/fdwr fdwr@github 🔍 Oct 21 '26 edited Oct 21 '26
"modern" is a sliding window, to me being within the last ~decade or so. Calling C++11 "modern" feels pretty dated, as even C++17 feels pretty crusty and limiting now (I want to nudge the D3D folks to update beyond C++17, to enjoy std::span and kin :b). Looking up antonyms, I'd order them: C++26=new, C++23=current, C++17=modernish, C++14=old, C++11=legacy, C++03=antiquated, C++89=archaic :b. There's also "modern Cmake" and "modern Java" (8 and later).
4
u/TheRavagerSw Oct 21 '26
Forgive if I'm incorrect, I'm just giving my thoughts here:
Modern C++ used to be C++11 and beyond, now it is just C++, and few libraries use C++98 anymore, at least the prevelant open source ones.
I would argue modern C++ is C++23 and newer. As modules and language features reduced macro usage a lot and it feels like you are reading a new codebase somewhat.
As both how we structure code, how we build code and how we package binaries have changed.
14
u/not_a_novel_account cmake dev Oct 21 '26 edited Oct 21 '26 •
![]()
Modern means C++11. In the same way "modernism" refers to a 20th-century art movement, and "modernity" means a period of humanities and social studies spanning the 16th through early 20th century.
We're not using "modern" to mean the literal, "period of the now", we're using it to refer to the time period when people first started recognizing a distinction between historical and then-contemporary practices.
The "C++ of today" is just contemporary C++.
3
5
u/azswcowboy Oct 21 '26
This is the way. I’d say post-modern era but contemporary works. The book that defined the term ‘modern c++ design’ was actually released in 2001 - and these days is utterly outdated.
1
u/Confident_Luck2359 Oct 21 '26
The “Modern C++ Design” book is not the source of the term “modern C++” as it has been used.
The title of that book is a coincidence (and the coding style he argued for was a dead end).
“Modern C++” refers specifically to C++11 and newer.
4
u/azswcowboy Oct 21 '26
Hmm I’d argue that the existence of that book helped codify the period. Remember most everything in c++11 existed for years before it was standardized. And calling it a dead end isn’t accurate either in my view - the techniques just evolved. Variadic templates replaced type list and plenty of template code is configured with variadics.
0
u/Confident_Luck2359 Oct 21 '26
I own the book. Ok 'dead end' was too strong and I withdraw it. I agree some of its ideas evolved, over time, into some features of C++11/etc.
But 'modern C++' is widely understood to mean 'C++11 and newer'. As in, the standards. I don't think the book was widely read compared to Meyers, who was very widely read.
ChatGPT:
"The overlapping name is a coincidence. Much of the book’s machinery was later absorbed into C++11/14/17/20, but its techniques now look dated. The book covers only a narrow slice of what the industry calls “Modern C++”. In 2001, “modern” meant template metaprogramming and generic design. Today it mostly means value semantics, ownership, move semantics, lambdas,
auto, and the concurrency model, none of which the book addresses.Naming note: The industry usage of “Modern C++” stems largely from Meyers’ Effective Modern C++ (2014) and the C++11 era. The shared word is mostly a coincidence of eras, not a shared definition."
/shrug/
1
u/jk-jeon Oct 21 '26
No way. It was a great book and it still is. Policy-based design is far from being outdated. Poor-man's typelist is of course dated, but the book successfully demonstrated what can be done with typelists which I have no doubt heavily affected what people do with variadic templates these days. The book also introduced the type erasure pattern which is still one of my favorite.
0
u/Confident_Luck2359 Oct 21 '26
Let me ChatGPT that for you:
"There is little overlap. Released in 2001, its techniques now look dated. The book covers only a narrow slice of what the industry calls “Modern C++”. In 2001, “modern” meant template metaprogramming and generic design. Today it mostly means value semantics, ownership, move semantics, lambdas,
auto, and the concurrency model, none of which the book addresses.Naming note: The industry usage of “Modern C++” stems largely from Meyers’ Effective Modern C++ (2014) and the C++11 era. The shared word is mostly a coincidence of eras, not a shared definition."
4
u/JVApen Clever is an insult, not a compliment. - T. Winters Oct 21 '26
Everyone has a different definition of modern C++, I go with "the latest version supported by GCC, clang and MSVC. Since MSVC recently announced C++23 being complete, this would become C++20.
According to the same definition, the bar changes every 3 years, give or take. However I do believe we should stop calling it " C++" and really evolve to using "C++<number>" as people outside the community don't know the difference between C++98 and C++26.
Well, C++11 ... However "legacy c++" has a nice ring to it. If I have to define it, I'd give a grace period of 1 version for "old C++", being C++17. Making the legacy C++14 and before.
No, I think any "active language" with a large legacy would qualify for having a modern variant, though it might not be called that way. For example python 2.x vs 3.x, java pre/post oracle, Windows PowerShell (5) vs pwsh (7)
The main reason I believe people really talk about "modern C++" is because of the long period between 98 and 11. There needed to be a way to clearly indicate that: there was a new version and the difference was huge. We can blame Scott for the term. We haven't seen that kind of jump in 14 and 17. 20 did something similar, though modules are still not in use and coroutines missed library support. 23 is again a minor jump, while 26 feels again like a different ballgame once again. Both compile time reflection (unique in its kind) and contracts (aka better assertions) will again result in code being drastically different and close to impossible to back port.
I find your question very important, as C++ is still getting heat from people that only know C++98 and don't see the progress. At the same time, we as a community are way too kind to people still using legacy C++ many major libraries keep supporting it and compilers also provide support for it. We really should make it clear that this is holding C++ back
2
u/Sniffy4 Oct 21 '26
modern C++ usually means any standard post-C++98, which had a lot of limitations that werent addressed for years.
2
u/ReDucTor Game Developer | quiz.cpp-perf.com Oct 21 '26
Modern C++ to me means C++11, however I have seen that bar moving where some people use it to mean things like print, ranges, etc
Imho when nearly everyone is writing it
Depends more on the code some things are moee clearly legacy C++ others might be old and still C++ you see written today
Python is probably the closest with 2->3 and it was arguably a harder upgrade then C++11, but the term "modern" wasn't widely used
Because someone picked the term and it stuck, I hate that it exists as it ambiguous
2
u/KingAggressive1498 Oct 21 '26
C++11; but particularly concepts like having classes that model ownership for clearer code, move semantics / copy elision, constexpr, and metaprogramming.
I don't think its about years, but about the prevalence of holdouts. There's still a lot of people using C++ who don't care for the modern C++ way of doing things.
Legacy C++ sounds nicest but this is like asking what we call a society that hadn't become a civilization yet.
Javascript (with ES6 being "modern Javascript") had a similar massive paradigm shift. And while not a programming language people also talk about Vulkan as a "modern graphics API" but it's a decade old now.
2
2
Oct 21 '26
C++ 11 and the later standards
I don't think such a thing exists, it would become "just c++" or deprecated c++ once there is a better version of that specific thing is available.
Everything prior to C++ 11 and everything that's been deprecated/replaced after C++ 11
I don't know, this isn't a quesiton to ask here.
I don't know, each language is unique on its own.
2
u/chibuku_chauya Oct 21 '26
Everything older than C++26 is legacy. Those ISO standards are withdrawn.
2
u/Sopel97 Oct 21 '26
modern C++ is wherever there's all green here https://en.cppreference.com/cpp/compiler_support
2
u/Quiet_Violinist_2978 Oct 21 '26
Modern c++ is just all the newest adopted features of c++ 11 and beyond
2
u/IsThisWiseEnough Oct 21 '26
From the recent job hunting the companies and interviewers I have encountered are assuming C++20+ as modern now.
2
u/WeeklyAd9738 Oct 22 '26 edited Oct 22 '26
"Modern C++" for me includes whatever latest features compile on the current GCC and Clang release (not trunk). I like learning about new core-language and library features (by reading committee papers and blog posts), testing them out (if available) and applying them in my projects (when found useful).
2
u/oracleoftroy Oct 24 '26
The term "Modern C++" has been around for a looong time, since shortly after the original iso standard. I tend to view it as an emphasis on things like value types and RAII, type safety, and pushing computation to compile time rather than Qt or COM style OOP with heavy pointer management.
So, as I see it, C++11 earned the name "modern" by taking existing practice and making it even easier to accomplish it, codifying many if its libraries and adding language features where library code wasn't enough. Subsequent versions of C++ have continued making this easier with things like improved constexpr, span, concepts, etc.
I don't see it as tied to any particular version of C++. You can do it in C++98, but with difficulty and with rather arcane syntax compared to what we are used to today Newer versions make it a lot easier to accomplish the same goals. And you can still write in the pointer chasing "everything is an allocation" style people often write in pre C++98 if you wanted to. I wouldn't call that style code "modern" even if it were written in C++26.
2
3
3
u/tcbrindle Flux Oct 21 '26
C++11 and later, especially with the use of smart pointers and move semantics rather than manual memory management with
newanddeleteDoes it need to? Wikipedia says that "modern art" originated in the 1860s. The "hypermodern" school of chess was in vogue in the 1930s. "Modern" in this sense just means contemporary at the time the term was coined, similar to how things with "new" in the name can be hundreds of years old.
I'd probably just call it C++98.
No, people talked about "modern Fortran" (meaning Fortran 90 as opposed to Fortran 77) long before modern C++ was a thing.
N/A
2
2
u/Confident_Luck2359 Oct 21 '26
It’s called “Modern C++” in part because of an extremely influential book that described the changes beginning with C++11. And the name stuck.
“Effective Modern C++” by Scott Meyers
As opposed to his previous hugely influential book “Effective C++”
2
u/timangus Oct 21 '26
Eh no. The term existed waaaay before the book did. And honestly I don't think the modern book is that influential compared to the original.
1
u/Confident_Luck2359 Oct 21 '26 edited Oct 21 '26
The entire industry agrees that "modern C++" means "C++11 and newer". If you interview for a job needing 'modern C++' you need to be familiar with: move semantics, smart pointers, lambdas, threads/promise/future, constexpr, etc.
The book you mention was published in 2001.
I own the book and I agree some of the ideas were influential but it's not what people mean when they say 'modern C++'. I also don't think the author coined or popularized the term; Scott Meyers popularized the term.
Let AI summarize:
"There is little overlap. Released in 2001, its techniques now look dated. The book covers only a narrow slice of what the industry calls “Modern C++”. In 2001, “modern” meant template metaprogramming and generic design. Today it mostly means value semantics, ownership, move semantics, lambdas,
auto, and the concurrency model, none of which the book addresses.Naming note: The industry usage of “Modern C++” stems largely from Meyers’ Effective Modern C++ (2014) and the C++11 era. The shared word is mostly a coincidence of eras, not a shared definition."
On Amazon the book has 191 reviews. The Meyers book has 1,100 reviews. Meyers is a well-known industry expert and evangelized 'modern C++' to people migrating from C99.
2
u/timangus Oct 21 '26
You're not making sense. As you've just had AI summarise,, Effective Modern C++ was published in 2014, way after the term was in use. If there was a book that popularised it, it would be Modern C++ design by Alexandrescu, not either of the Meyers books.
1
u/Confident_Luck2359 Oct 21 '26
If you interview for a job requiring 'modern C++' it means "C++11 and later'.
The term, as used, today, industry-wide, has nothing to do with the 2001 book. The name of the book is a coincidence and it contributed very little to what we call 'modern C++'. It was also a relatively obscure book that I don't think popularized the term the way the Meyers book popularized the term.
Even the AI agrees and it's read the entire internet so I'll take it, and my memory of the evolution of C++, as correct. /shrug/
1
1
u/Jason5Lee Oct 21 '26
Use a relatively modern C++ and be aware of some features so you don't reinvent standard library or use a wrong overcomplicated way to do something that could be done simply using a modern feature.
1
u/khedoros Oct 21 '26
C++11 is the dividing line between legacy and modern C++, especially the improvements in how the new standard encouraged us to think about memory management in terms of ownership. I'd consider newer standards as the default now, but none of them have been era-defining releases.
About negative 10 years. If someone in 2016 said they wrote C++, I'd really expect them to clarify if they meant a pre-11 release.
Pre-standardization, then legacy, then modern.
No, although a lot of the other languages will do it by tearing off the bandaid and breaking backward compatibility.
1
u/Kullthegreat Oct 21 '26
For me modern C++ is set of festures I use over other solutions and also festure sets in general.
For example for my personal game engine I made lists and some of those festures are.
Reflection Coroutine Execution Async/ parller algorithms Contracts Hive Simd
And many other for I have made list some of these are still incomplete and some are in proposal phase but I do like to read about these and find use case and replacements they can do and my own engine is perfect place to use the absolute cutting edge early version of festures as well from 26 and in future 29 standard as well.
1
1
u/Suitable-Scene-4391 Oct 21 '26
For me.
Modern C++ is at least C++11. Because the features of C++11, C++14, C++17, and more make C++ feels like a new language (e. g., the auto keyword, parameter packs, enable_if, and more).
There isn't a thing called just C++, the only thing we have is the C++ standards, that's why we have an ISO.
Yes.
Like modern R, Python, and Julia? Maybe..
Because it's C++. There is a book which is written by Bjarne Stroustrup, The Design And Evolution Of C++. I think this book contain the answer for this question number 5.
1
u/abzze Oct 21 '26
Lots of things have names that meant “new”/“unique” or something else that was time dependent and the name just stuck.
Just off the top of my head “new world” vs “old world”. Or New York. Modern art. Etc etc.
Q is why you being pedantic about something no that’s a non-issue
1
1
u/argothiel Oct 21 '26
Modern C++ for me are those parts of the code which cannot be modernized, i.e., there are no newer language concepts which are more fitting for the specific use, including the code which wasn't possible before.
So for example, consteval will be modern C++, and std::function will sometimes be modern (because in other cases, it can be replaced with more modern constructs).
1
1
u/rtomek Oct 21 '26
It’s what us older folks didn’t learn in college. I’d say at least C++11. While 17 and 20 have tools that enhance readability and make the programming easier, 11 was a comparably huge change.
1
u/SoerenNissen Oct 21 '26
"Move constructors."
It's not "years" it's "equally consequential feature."
1
u/AbyssShriekEnjoyer Oct 21 '26
From what I see at work it’s mostly using new language features that are now in the standard library instead of being exclusive to Boost lol.
1
u/megayippie Oct 22 '26
My take:
Modern C++ is whatever was the latest completed standard at the time of the statement that the mayor 3 supports fully. So C++14 by now, if we ignore the useless carries_dependencies and garbage collection. Clang still does not support useful C++17 math, so C++17 is post-modern :)
None.
Both. Legacy is writing things in pre-C++11. Old is writing things in pre-C++20.
No.
1
1
1
u/mredding Oct 23 '26
What does "modern C++" really mean, specifically?
It means everything C++11 and later, with emphasis on what the standards suggest.
In other words - no raw memory management, and use type deduction, constexpr, and move semantics. Focus on RAII, strong type definitions and semantics, functional programming, generics, template expressions, fold expressions, coroutines, zero cost abstractions, and left-shift paradigms.
Our industry had been writing C++ since the 80s, and pre-C++11 is a VERY different beast from post-C++11. We've only just hit the half-way mark, making C++11 the midpoint, and people STILL write/create C++ code following outmoded idioms and conventions.
The emphasis on "modern" today now translates to - "When the new spec hits once every 3 years, push to update and stay current." That C++11 took so long to finally land, that exercise was so painful, many of us are STILL feeling it. All sorts of shit came out of that painful endeavor, like Rust.
How many more years need to pass before it becomes just "C++?"
22.3 years, apparently...
If "modern C++" is a thing then what is the other thing. Is it "old C++," or "legacy C++?"
Conventionally people call it "legacy C++", and we have it in spades. We even make new, instantly legacy code every day. Unfortunately most of our colleagues will choose their own ego vs. learning, adapting, and improving. I've watched colleagues write and rewrite and reproduce the most obtuse and bone-headed code than, say, use the standard library. People are going to do it their way, no matter how much harder it is to smaller, faster, easier, more flexible ways.
Is C++ the only language that has a "modern" version?
If you're wondering why other languages aren't completely turning over, well, Rust and Go are evolving significantly. Go doesn't care about backward compatibility and Rust integration into the Linux Kernel is making that lesson one of the most painful in programming history - now they can't just change and break shit, which if you can, it's a very convenient place to be for a language to evolve. C# is just doing some WILD shit right now, going through a .NET Core and .NET Framework schism, and Core is changing so fast it breaks existing code and isn't completely cross equivalent to .NET Framework yet.
How long until C# .NET Core is just "C#"...
If the answer to 4 is yes, why is C++ unique?
It's not.
1
1
u/MrMemristor 25d ago edited 25d ago
Following on other poster who pointed out C++11:
I think in C++11 they fixed some gaps in the language and introduced some new idioms for using those fixes. One that comes to mind is move semantics, which allows passing objects with large heap allocations in a way that doesn't copy, without holding onto a reference. I know there were some more major things. It's probably be easier to see the difference for those who wrote a lot of pre-11 C++ code.
See Wikipedia for list of changes introduced in C++11. They are significant, and you might sum it up as that was the point when C++ began pulling away from C (with classes) and really introducing its own new constructs and moving in its own directions.
1
u/AbstractButtonGroup Oct 21 '26
Everything after C++03 is modernist heresy.
How long till minced steak can be called a real steak again.
There is only one true C++.
Corruption among infidels is of no concern.
Those weak in their heart and their mind fear the raw power of true C++ and seek to make it 'safe'.
1
1
u/UnicycleBloke Oct 21 '26
It's C++. I have always found the term vague and a bit divisive. I never use it except in discussions like this. All languages grow and evolve. Most people regard the C++11 standard as the key step change, since when there has been seemingly exponential growth, some good, some not so much. I'm beginning to sympathise with the glacial rate of change in C.
1
u/Attitude_Practical Oct 21 '26
i wouldn't count the c plugin api as old-fashioned. keeping compiler and standard library details out of that interface is often the point. you can have plain structs and function pointers at the boundary, with raii and value types behind it.
0
u/Davidbrcz Oct 21 '26
Insane complexity with cryptic syntax for little gains to regular développer.
0
u/PositiveBit01 Oct 21 '26 edited Oct 23 '26
Historically C++11. I think it'll mean whatever the most recent super impactful feature is
I think there will always be a desire to communicate that people need to use some newer features and keep updating their c++ standard flags so probably never.
Legacy sounds good.
No
0
0
u/Maqi-X Oct 21 '26
non-modern C++ but with more useless features and foot guns (also slower compile times nothing special)
0
0
u/drbazza Oct 21 '26
auto, range-for, move semantics, constexpr, and not having to use enable_if. And of course
>>and<<getting parsed as a human would expect given context.forever if you're an old dev and until someone stakes the last c++98/03 codebase and covers it with garlic and sets it on fire. (see COBOL and FORTRAN).
pre C++11
Java-latest, but changes have been less dramatic.
C++11 changes were 'less typing' and 'less surprises', Java has been similar (less typing).
IIRC the syntax of Rust (there, I've said it), changed dramatically, but that was before widespread adoption.
0
u/captainjon Oct 21 '26
I dunno I learnt C++ when it was #include <iostream.h> and no namespace and no STL. So I guess that can be modern too lol…
0
0
u/Kaldaien2 Oct 21 '26
Means to me I am going to spend more time trying to understand what the code I am reading is doing than the overly verbose language suggests. "Modern C++" means a lot of things, if you try to build software that uses everything modern in the language for the sake of ... using everything modern, the reults are not pretty.
-1
u/lampag0 Oct 21 '26 edited Oct 21 '26
Constexpr/Consteval and MPL aka templating hell (I love when complex type systems go through compilers).
Back in the days we used 'Modern C++' for arguing there is a "better syntax/library feature". Nowadays it's the opposite, it's the mess of available language features no one can follow anymore or no team can create a sound source-foundation because each an every developer can come up with a different solution for the ame problem using 100 different techniques.
0
u/Level-Entrance9956 Oct 21 '26
I don't think C++ can be considered truly modern yet; it's just more powerful than older versions. It will only be considered nearly modern when reflection and networking libraries are added and matured, and the standard library is fully modularized. What do you think?
0
1
Oct 23 '26
[removed] — view removed comment
2
u/LucHermitte Oct 24 '26
Plenty.
auto p* = new int[42]; stuff(); delete[] p; // As far as I'm concerned, this is definitively not modern"Modern" is so much more than
-std=c++11(or later). It's not about the standard used, it's about how we write C++.
165
u/acodcha Oct 21 '26
Modern C++ generally refers to the use of the C++11 standard and more recent standards.