This is such a bad resource. Promoting bad practices, giving wrong reasons, half-ass explanations that can easily lead to extremely slow code.
I’ll mention the problematic tricks:
Trick 4:
Already have been explained in this thread, it is very bad practise and makes your code lose portability. In CP its justified to use it though.
Trick 5:
Why should use of make_pair be avoided? Literally no reason supplied.
auto p1 = make_pair(x, y);
pair<string, string> p2 = {x, y};
Both are equally good, infact make_pair can shorten your code (with auto).
One thing I would like to mention is that advice: “use {} instead of make_pair” is REALLY bad, what if someone learns about auto and tries:
auto p3 = {x, y};
This code fails miserably.
Trick 7:
The advice is good, using for (auto it : container) is actually pretty good and prevents from falling into some unexpected copying and hence wrong results, but it’s a half-ass advice.
Please mention that you should use for (auto &it : container) in case of data type being bigger than a normal pointer size, otherwise big copies will happen and slow down the program.
Heck another problem is what if someone wants to change elements and they use auto without &, the actual values won’t even change => WA.
Trick 8:
Just WHY recommend this? Neither does it shorten the code or speeds it. It only makes it more difficult to debug.
Trick 11:
Yes emplace_back should be preferred, but the reasoning seems incomplete(to me). I’m not proficient at STL so won’t comment, but seems incomplete if not wrong.
So whoever wrote this, I would like to request you to first learn before making tutorials/tricks/tips. Not only you’re making yourself look like a clown, you’re also teaching wrong things to beginners, which contrary to your goal of helping the community, sabotages it a little.