delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/18/03:15:27

From: "Thomas Mueller" <tmueller AT bluegrass DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: whats wrong with my compiler
Date: 18 Nov 2002 08:01:41 GMT
Lines: 39
Message-ID: <ara6p3$gfkfr$1@ID-49635.news.dfncis.de>
References: <20021115043144 DOT 31342 DOT qmail AT web13005 DOT mail DOT yahoo DOT com>
NNTP-Posting-Host: tnt01-94-232.bluegrass.net (216.135.94.232)
Mime-Version: 1.0
X-Trace: fu-berlin.de 1037606501 17289723 216.135.94.232 (16 [49635])
X-Mailer: NOS-BOX 2.05
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019