+ 1

What is the hardest part of C++ to learn and understand?

4th Aug 2017, 10:29 PM
Chris
Chris - avatar
7 ответов
+ 9
Using modern C++ properly. You have to find good books on C++, there's not a lot of tutorials that teach modern C++. A lot tutorials still tell people to use new and delete with raw pointers and to use c arrays. Those two things are some of the biggest contributors to buggy and unsafe code in C++. Every C++ programmer should understand: smart pointers, move semantics, the rule of 3 and 5, every STL container there is and which one is best to use on a case to case basis, range loops, lamda functions, RAII, modern random number generation, the auto keyword, class hierarchy, SL algorithms, constexpr, nullptr, multi threading using the standard library, and many more.
4th Aug 2017, 11:43 PM
aklex
aklex - avatar
+ 7
aklex, also the nullptr keyword. I had a hard time moving from NULL to nullptr because I was so used to writing NULL basically with muscle memory. Its hard to adapt to C++ because it is updated so often.
4th Aug 2017, 11:51 PM
Karl T.
Karl T. - avatar
+ 4
@Karl T. Added to the list :)
4th Aug 2017, 11:53 PM
aklex
aklex - avatar
+ 4
For me it is, -Trees- I plan to make a code with trees to fix that
5th Aug 2017, 1:14 AM
Manual
Manual - avatar
+ 2
For me personally I found pointers a little tricky. This then leads in to things like linked lists and binary trees which I also found difficult. But just try to get your head around a 3 dimensional array cotaining pointers. I dare ya! Where are on earth are they all pointing to?
4th Aug 2017, 11:38 PM
James Cooke
+ 2
@aklex I've been studying C++ with the book "Jumping into C++" and I've just got into dynamic memory allocation section. Although the book goes somewhat fast I'm starting to understand it pretty well
4th Aug 2017, 11:47 PM
Chris
Chris - avatar
0
Exactly what aklex said. I am quite sure she meant STL algorithms, but the rest is basically that.
5th Aug 2017, 12:02 PM
Denis Felipe
Denis Felipe - avatar