Mail Archives: djgpp/2002/11/18/14:00:08
Thomas Mueller wrote:
>
> 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.
Question then: Is this by intent/design of the Standards committee or is
it an artifact of bad vendor implementation?
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.
Correct is too laden a word to use here. Current is perhaps more
appropriate.
The use of iostream.h vs. iostream is going to be just one of many
tricks of porting that many C++ programmers are going to have to be
aware of. I wouldn't disagree that it is best to use the latest and
greatest, however, C++ appears to have a problem with changing moreso
than other software products out there. As to good or bad remains to be
seen regarding how much cost this is going to impose on porting legacy
code.
And.... for those who learn by picking up a book and learning at home
and who are going to spend countless hours trying to figure out why
their code as written will not work.......let's not go there.
> 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.
At sometime you will need to get Stroustrup's book. Vendors don't argue
with you when you say your code doesn't work as compared with
Stroustrup. Usually they say, send us a sample - please.
>
> > 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.
If properly written and properly compiled, there should be no problems.
The fact that someone isn't using the latest and greatest shouldn't be
an issue.
>
> 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.
I don't remember if the Third Edition or Special Edition is current, but
be aware!
Jeff
- Raw text -