Mail Archives: djgpp/2002/11/18/03:15:27
Excerpt from Thomas Tutone <thomas8675309 AT yahoo DOT com>:
> I agree with the point you make - that this trap has
caused misery for newbies everywhere, and that this is
unfortunate. But I think the advice you would give is
wrong. Using <iostream.h> is a really bad idea. Let
me explain why. On many platforms, you can't mix
standard headers (like <iostream>) with legacy headers
(like <iostream.h>, even if those legacy headers still
exist. Think about what that means. On such
platforms, if you use <iostream.h>, you can't use
<vector>, or <algorithm>, or <memory>, or other
components of the modern C++ Standard Library without
getting compile errors. You're stuck using the
pre-standard versions, if they exist. In other words,
it leads to many, many additional compile errors, and
a lot more confusion. That means that programmers who
get in the habit of using <iostream.h>, as you
advocate, will have endless problems once they advance
beyond "Hello World" programs. Better that they
should learn the correct usage in the first place.
That was why I encouraged the original poster to get a
copy of Koenig (also heavily involved in drafting the
standard) and Moo's "Accelerated C++." It teaches the
proper habits from the start. So does Stroustrup's
book, but it's pretty hard for beginners to follow.
> My apologies to the mailing list for my off-topic
rant. But it bums me out when I see people making this
mistake, and even more so when I see other members of
the list encouraging them to do so.
No need to apologize, I wouldn't call it off-topic. Programmers need to know
why using old standards is likely to lead to errors.
I just looked and found my copy of Bjarne Stroustrup's book was the second
edition, so will have to get the third, and look to online sources for things
like tutorials. I am out of practice programming C and C++ but not a beginner.
- Raw text -