A transition tool that is no longer needed, if only C++ was taught to modern standards. Too many instructors don't.
Older code is one thing. Writing new code to old, near-obsolete standards is not good.
@TwilightSpectre, I read something similar years ago myself. That is the main reason why I don't use it.
I really don't like in general using-declarations either, for example:
using std::cout;
If I do have a using-declaration I restrict the scope as narrowly as possible. The way Boost is laid out makes me bend the "won't use ever" rule.
using also has a place as a type alias, if used sparingly. Rules can be bent when readability is enhanced.
zapshe wrote: |
---|
My first professor said it was bad practice and then proceeded to always use it and teach the whole class to use it. |
Saint Bjarne says much the same, bad practice, and still uses it in his lectures and books on C++.
It wouldn't be so egregiously horrible, but he buries the using-directive in a header file he reuses again and again.
Too bad a perfectly good keyword (
auto) is ignored by many instructors. C++11 usage makes replacement typing loooooong Standard Library/STL constructs easier to understand and read.
STL containers' iterators for example.