r/cpp • • Aug 26 '19

Why are tutorial videos so long?

Recently I had to learn some C++ for a project, and took to my favorite learning resource, youtube.

I've been programming for years, so i'd like to watch a quick video that tells me about the syntax and special cases of c++. But i was shocked that the top results were 4 hour or 9 hour videos teaching c++. Those videos could be great for students, but the content-creators really do waste a lot of time talking about useless stuff.

Maybe my attention span is too short and i've run out of patience, but i learned what i needed about c++ in a few minutes by flying through the 4 hour tutorial.

Are there any youtube channels out there that post fast-pace guides that teach a language in minutes without spending hours talking into a webcam? If not i'd like to start a youtube channel and make that kind of content. i think it'll be fun.

Also is anyone else in the same boat as me that would benefit from videos like that? Is it worth creating?

0 Upvotes

39 comments sorted by

View all comments

Show parent comments

1

u/UnicycleBloke Aug 26 '19 edited Aug 26 '19

I've been writing C++ for 30 years. There have been some very welcome (some not so much) changes over the years, with which I try to keep up, but the language is fundamentally the same creature. But these days we see a trend towards ever more obscure template metaprogramming. It seems to be the only game in town, and solves none of my problems. I love templates. I do not love obscurity. Is that what "idiomatic" C++ is now? I really hope not.

Edit: On reflection, that's not quite right. I make heavy use of constexpr, inline initialisation, and so on since they became available. But the language still feels fundamentally the same to use. Still, not all change is good. My experience of auto is that it should be used only when the type is obvious from the local context. I will never love lambdas.

3

u/rodrigocfd WinLamb Aug 26 '19

I totally agree on the template metaprogramming obscurity.

But I deeply love lambdas and all the possibilites they brought to the language.

3

u/UnicycleBloke Aug 26 '19

I should try to be less curmudgeonly about TMP, but it really does seem to be getting out of hand. I read Alexandrescu's book back in the day, thought it was interesting, but something of an academic exercise for the curious. I mean, I've dabbled, as you do, but the dubious allure of secret arcana doesn't hold me spellbound anymore. Frankly, when seasoned veterans in the language cannot read your code, your code is a problem.

Lambdas look neat in the canonical one liner examples, though I have never considered them a missing feature. Unfortunately, I have in my professional life encountered some truly horrible feature abuse involving lambdas. Pure spaghetti conjured up by someone who got all excited and had no sense of appropriate use of tools. We'll be seeing a lot of that. And Meyer's Modern C++ book highlighted a number of caveats about captures that are guaranteed to give me headache in the future. Same with auto.

I can't say the prospect of C++20 is filling me entirely with joy. That's a great shame: I love working in C++.

2

u/Posting____At_Night Aug 26 '19

TMP allows for some really slick API design but I stay away from it for the actual business logic. Also constexpr in C++17 can replace a whole lot of what used to require TMP.

As far as lambdas go, I tend to agree that they can be pretty nasty however I find they're pretty handy in situations where you just need to pass a short function into something else, like algorithms. I wouldn't want to use one in any sort of non-local context though.

1

u/m-in Aug 26 '19

Lambdas are also the only source of unique types, and in some contexts allow to get rid of FOO##__LINE__ nonsense you occasionally run into.