Learn Modern C++
A new “Learn Modern C++” tutorial site prompts praise for its clarity but also questions about what “modern” really means in a language that keeps evolving. Commenters highlight recent features like C++23’s `std::println` and `std::format` as quality-of-life improvements over iostreams, while noting that compiler support and real-world adoption lag behind the standard. Much of the debate centers on C++’s growing complexity, the burden of keeping up with changing best practices, and whether newcomers should invest in C++ at all given alternatives like Rust, even as C++ remains deeply entrenched in systems, games, and performance-critical software.
Tutorial and Additional Resources
- Many appreciate that the tutorial is clear, original, self-contained, and shipped with a GitHub repo (good for offline/E‑reader use).
- Some find it overly verbose and “hand-holding,” preferring more concise, example-driven styles like classic C/C++ books.
- Suggestions include next/previous navigation links and integration with modern interactive tooling (godbolt-style, playgrounds).
- Other recommended resources: C++ Core Guidelines, learncpp.com, a “Modern C++ Programming” course repo, and various talks/papers.
“Modern C++” and std::println / std::print
- Debate over what “modern” means: some argue C++17/20 is the realistic target; C++23 features feel “futuristic” because compiler/library support is uneven.
std::println/std::print(C++23, based onstd::format/{fmt}) is seen as the “modern-modern” way to print, versusstd::cout <<andstd::endl.- Others note this is not yet portable or widely available, so {fmt} or older patterns remain practical.
Iostreams vs Format-Based I/O
- Several argue iostreams were a mistake: verbose, inefficient, hard to internationalize, clunky with Unicode, and baroque in design.
- Others defend iostreams as “good enough” and not the real bottleneck in many systems.
- Format-style APIs (
std::format,std::print) are praised for type safety, flexibility, positional arguments, and consistency with other languages.
Const, Aliasing, and Language Complexity
constis described as both valuable and frustrating: it’s an “API promise” that can be undermined by aliasing,const_cast,mutable, and subtle UB.- Some argue you should avoid
const_cast/mutableand lean on RAII, “rule of zero,” and newer features like “deducing this.” - Others feel
constand aliasing rules limit optimization, increase cognitive load (“colored functions”), and don’t guarantee intuitive behavior.
C vs C++ vs Other Languages
- Opinions split:
- “C with classes” is viewed by some as ideal; others say that style is bug-prone and you should fully embrace modern C++.
- Some recommend learning C first to understand memory/pointers; others call that the “worst possible” path, arguing it ingrains unsafe habits.
- Many compare C++ unfavorably to Rust, Zig, Haskell, etc., but acknowledge C++ remains dominant for games, performance-critical, and legacy-heavy domains.
Keeping Up with the Evolving Language
- Concern: C++ accumulates features, styles, and build systems; reading multiple codebases feels like reading different languages.
- Counterpoint: you don’t need every feature; most developers use a subset, and you can largely ignore older constructs and adopt newer, safer ones gradually.
- Some say the complexity and shifting best practices pushed them away from C++ entirely; others find C++20/23 materially more pleasant than earlier standards.
Tooling, Error Messages, and Learning Aids
- Complaints about poor/overwhelming compiler diagnostics and lack of a standard package manager.
- Some note Clang’s errors are clearer than g++, but both can still be enormous for template-heavy mistakes.
- Multiple commenters report using GPT‑4/ChatGPT as a very effective helper for debugging, learning library usage, and navigating modern C++.
Miscellaneous Topics
- Unicode: C++ has UTF‑8/16/32 string literal syntax; earlier looser rules for Unicode identifiers were tightened to avoid confusing characters and ensure normalization.
- Some practical notes on PIMPL vs C-style opaque structs, pointer usage, and examples of mostly pointer-free “modern” code.
- One commenter highlights that line-buffering and flushing behavior (e.g.,
'\n'vsstd::endl) is frequently misunderstood; claims conflict and remain somewhat unclear.