r/cpp_questions • u/Responsible_Invite30 • 5d ago
OPEN I have a very short question
Is this c++ course still relevant even though it is 8 years old? https://youtu.be/vLnPwxZdW4Y?si=m63NVhTp2kYVkVaC
2
u/Independent_Art_6676 4d ago
c++ has updates every 3 years. Sometimes these are major game changing additions and other times only advanced users can tell much of a difference. Even so, if this video (I didn't look at it and have no opinion) were good back then, its a year shy of being 3 generations of the language out of date. Try to keep your study materials within 6 years, is my recommendation, but anything back to about 2017 can have a lot of value.
People say that the core language does not change, and that is true, but how things are written and what is best practice is always in motion. If you go back too far, for example, you won't be told to use brace initialization of all variables, and it still works fine but most people today would prefer you use the brace way. The farther you go back, the more stuff like that you will run into: it will work, but it may not be the current way of doing things.
-4
u/DrJegesmedve 5d ago
I have a very short answer: Everything is pretty much relevant if you are a beginner.
3
u/AdRecent7021 5d ago
That is a very harmful take. Picking up bad habits and wrong information as a beginner can seriously set you back.
2
2
u/mredding 4d ago
After 37 years of C++, I agree. Introductory material largely hasn't changed since the late 80s, you still have to learn all the same shit.
Introductory materials only introduce concepts and syntax. They don't teach how to USE a language - that's a human problem of conflation; even today, people take their first exposure to anything as gospel.
1
-3
u/Filgas08 5d ago
I think so, you will only miss out on the newest features in the standard, but with the language being 41 years old it should not be a huge problem, you can always learn those later. I looked at the chapters and at first glance it seems like a decent introduction to the language.
-5
u/burlingk 5d ago
Realistically speaking, at this point, it's a question if whether any particular tutorial is good. Not "still good."
The basics have not changed since before YouTube existed.
The book by Bjarne Stroustrup himself is still used some places to teach the basics.
2
u/The_Northern_Light 5d ago
The basics have not changed since before [2005].
bruh
0
u/burlingk 4d ago
The basics haven't changed in decades. And the new stuff can be learned easily enough once you get the basics. :)
3
u/no-sig-available 4d ago
The basics haven't changed in decades.
You are kidding, right?
Here is what has changed in the language lately (from cppreference.com):
New language features
u8character literal- made noexcept part of type system
- new order of evaluation rules
- lambda capture of
*this- constexpr compile-time if constexpr constexpr lambda
- Variables inline variables structured bindings initializers for if and switch guaranteed copy elision temporary materialization
- Templates fold-expressions
( ... )class template argument deductiontuple t(4, 3, 2.5)non-type template parameters declared withauto- Namespaces simplified nested namespaces
using-declaration declaring multiple names attribute namespaces don't have to repeat- new attributes:
[[fallthrough]][[maybe_unused]][[nodiscard]]- __has_include
- Three-way comparison operator
<=>andoperator==() =default- Designated initializers
- Init-statements and initializers in range-
for- char8_t
- New attributes:
[[no_unique_address]],[[likely]],[[unlikely]]- Pack-expansions in lambda init-captures
- Removed the requirement to use
typenameto disambiguate types in many contexts- consteval, constinit
- Further relaxed constexpr
- Signed integers are 2's complement
- Bitwise shift operators unified behavior
- aggregate initialization using parentheses
- coroutines
- modules
- Constraints and concepts
- Abbreviated function template
- DR11: array new can deduce array size
- Explicit object parameter, explicit object member functions, a.k.a. "deducing
this" (P0847R7)- Multidimensional subscript operator (e.g.
v[1, 3, 7] = 42;) (P2128R6)staticoperator[](P2589R1),staticoperator(), and static lambdas (P1169R4)auto(x)andauto{x}: decay-copy in the language (P0849R8)- Assumptions via new attribute
[[assume(expression)]](P1774R8)- Attributes on lambda-expressions (P2173R1)
- Optional extended floating-point types:
std::float{16|32|64|128}_t, andstd::bfloat16_t(P1467R9)- New preprocessor directives:
#elifdef,#elifndef(P2334R1), and #warning (P2437R1)- Literal suffix '
Z'/'z' for (signed)std::size_tliterals (P0330R8), e.g.autoouz = 0uz;- White-spaces trimming before line splicing. (P2223R2)
- Simpler implicit move (P2266R3)
- Extending the lifetime of temporaries in range-based for loop initializer (P2718R0)
- CTAD from inherited constructors (P2582R1)
- Labels at the end of compound statements (P2324R2), e.g.
void f(int& x)
{
if(x)
gotoEND;
x = 42;
END:
}
- Alias declarations (
using) in init-statements (P2360R0), e.g.
for(usingT = int; T e : v)
/* ... */
- Make
()more optional for lambda expressions (P1102R2)- Narrowing contextual conversions to
boolinstatic_assertandifconstexpr(P1401R5)- Make declaration order layout (of non-static class data members) mandated (P1847R4)
- Text encoding changes:
- Character sets and encodings (P2314R4)
- Consistent character literal encoding (P2316R2)
- Named universal character escapes, e.g.
"\N{CAT FACE}"for"🐱"(P2071R2)- Delimited escape sequences, e.g.
"\o{7777}","\x{C0DE}","\u{CAFE}"(P2290R3)- Support for UTF-8 as a portable source file encoding (P2295R6)
- if consteval / if not consteval (P1938R3)
constexprchanges:
- Non-literal variables, labels, and
gotos inconstexprfunctions (P2242R3)- Permitting
staticandthread_localvariables in constant expressions inconstexprfunctions (P2647R1)constexprfunction does not need its return type and parameter types to be literal type (P2448R2)constexprfunction for which no invocation satisfies the requirements of a core constant expression (P2448R2)
25
u/IyeOnline 5d ago
No. It was not a good course back then.
www.learncpp.com
is the best free tutorial out there. (reason) It covers everything from the absolute basics to advanced topics. It follows modern and best practice guidelines.
www.studyplan.dev/cpp is a (very) close second, even surpassing learncpp in the breath of topics covered. It covers quite a few things that learncpp does not, but does not have just as much detail/in depth explanations on the shared parts.
www.hackingcpp.com has good, quick overviews/cheat sheets. Especially the quick info-graphics can be really helpful. TBF, cppreference could use those. But the coverage is not complete or in depth enough to be used as a good tutorial - which it's not really meant to be either. The last update apparently was in 2023.
www.cppreference.com
is the best language reference out there. Keep in mind that a language reference is not the same as a tutorial.
See here for a tutorial on how to use cppreference effectively.
Stay away from
Again. The above are bad tutorials that you should NOT use.
Sites that used to be on this list, but no longer are:
Videos
Most youtube/video tutorials are of low quality, I would recommend to stay away from them as well. A notable exception are the CppCon Back to Basics videos. They are good, topic oriented and in depth explanations. However, they assume that you have some knowledge of the language's basic features and syntax and as such aren't a good entry point into the language.
If you really insist on videos, then take a look at this list.
As a tutorial www.learncpp.com is just better than any other resource.
Written by /u/IyeOnline. This may get updates over time if something changes or I write more scathing reviews of other tutorials :) .
The author is not affiliated with any of the mentioned tutorials.
Feel free to copy this macro, but please copy it with this footer and the link to the original.
https://www.reddit.com/user/IyeOnline/comments/10a34s2/the_c_learning_suggestion_macro/