That's like saying, "They shouldn't teach you arrays, only vectors"
You learn the base and learn how it was improved and used in practical purposes.
That's like saying, "They shouldn't teach you arrays, only vectors"
You learn the base and learn how it was improved and used in practical purposes.
I agree that folks should learn both new and old, but I prefer teaching new first, then comparing with the old to see how sucky things were in the past.
It's sort of like teaching a kid to drive on an automatic instead of a stick. You really ought to learn stick, but at least get the basics of driving on roadways down first without worrying about low level stuff.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Why shouldn't they learn the C part of C++? When they encounter it in the real world it would certainly help to know that char* is also a string, but that it must be used in a more obtuse manner than a std::string.
Teachers also have a bad habit of not telling students that what they're learning in a particular exercise is only for learning purposes and that in the real world they should do it the easy way by using the appropriate algorithms or member functions.
You wouldn't believe how many convoluted manual linked lists I've seen people use at work when there's a much better and easier one sitting in the <list> header!
They should, though I think that the Koenig and Moo approach of using the standard library containers to teach basic concepts is the way to go.Why shouldn't they learn the C part of C++?
That is not true in this case: std::reverse works as well on a C-style null terminated string as on a std::string. One would just pass pointers to char (taking into account the null terminator) instead of std::string iterators.When they encounter it in the real world it would certainly help to know that char* is also a string, but that it must be used in a more obtuse manner than a std::string.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
In my experience a lot of instructors have no real world experience in the first place. It is a bizarre state of affairs. There's computer science, and then there's software development. Currently the situation is that software development is being taught largely by computer scientists who have lived in academia far too long. So the students are left to their own devices and suffer "trial by fire" in the real world.
The problem I think is that good software engineers are extremely well paid. It's just not worth their time to teach when they could actually be practicing their craft in the real world. The result is that these concepts are taught by people who, although intelligent, are not living in reality.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
When I was an undergrad in CS taking the required Software Engineering courses, they were taught by a SSE from Intel. At the time, the man seemed like an alien. Nothing like any of our other instructors, and people didn't really take him seriously. Looking back now, the guy was incredibly skilled and should have been listened to more closely. But even getting the chance to talk to a worldly engineer is still a rarity.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Relax guys, it's not for school. I'm reading Beginning ANSI C++ by Horton and trying to keep up.
In the book, he mentions that making use of the string class is preferable over the use of a char array.