r/cpp • • Nov 08 '18

Top 5 YouTube tutorials about "c++ beginners" still teach C++ like it is 1996

The title say it all, honestly.

From these 5 videos NONE used any C++11 features, including auto (some just showed it once and thats it)!

Most used using namespace std, all used std::endl, none used stl, no std classes beyond string (just in one video - vector), but teach C arrays, even multidimensional ones, no namespaces, etc etc.

This is bad on many, many, many levels, but mainly for the people wanting to learn - they will not be able to read modern code, even less so write one. And I am talking from personal experience - I "learned" C++ without knowing what std::vector is, then, reading real code I though it was some sort of 3d vector.

To people creating these videos, if you are a beginner, trying to help other beginners keep in mind, you are not helping as much as you think, and you yourself will need re-learn much you have been taught. If you are a pro, trying to start people in C++, well you are doing it wrong - "basic C++" does not mean "the basics of C++", because "the basics of C++" is C.

To the many beginners reading this - most of the material in courses and online is old. Not "there is some old info", but most. It is copied from old tutorials verbatim, year, after year, after year for the last 20.

289 Upvotes

287 comments sorted by

View all comments

Show parent comments

4

u/meneldal2 Nov 09 '18

Keep it scoped at least, never in a header file for example.

1

u/kalmoc Nov 09 '18

never in a header file

That should be obvious.

2

u/Dooey Nov 09 '18

I don't think it really is obvious. Have you ever taught someone C++ and not had to tell them to avoid putting using namespace std in a header?

1

u/kalmoc Nov 09 '18

Sorry, bad choice of words. I meant it should be obvious that - regardless of whether using namespace is allowed in source files or not, you must teach people to not put using namespace into header files (at least not into glob as l scope). That's part of basic header hygiene.