From 8398539118016292402
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,22698cf43904ecac
X-Google-Attributes: gidf78e5,public
From: bs@research.att.com (Bjarne Stroustrup)
Subject: Re: iostream changes
Date: 1997/09/11
Message-ID: <EGDHsv.60w@research.att.com>#1/1
X-Deja-AN: 271764645
References: <340BA7EE.500A@parawave.com> <5v6ife$64h@hermes.synopsys.com> <34173136.52AA@Eng.Sun.COM>
X-Original-Date: Fri, 12 Sep 1997 02:05:19 GMT
Organization: AT&T Research, Murray Hill, NJ, USA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBNBikQ0y4NqrwXLNJAQHcfQIAnAeeNpun7EubGy7xgRTjVsIdFqGul3Yv lNeoKURDb7Je2vjjdqP6SdoAOXPSoR38Gl6CLa8iZ6BRiLXbjC0rlQ== =1++D
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com



As part of a very nice posting about standardizing C++ and problems
with the "Hello, world!" program using iostreams, Steve Clamage writes

 > I sympathize with Al Stevens' problems trying to write about
 > C++ in a changing world. I claim his problems are no worse
 > with the advent of the standard than they were before. The
 > situation is analagous to writing about C in, say, 1989.
 > This too shall pass.

Indeed, consider the famous program from K&R1:

	main()
	{
		printf("Hello, world!\n");
	}

The ANSI C committe - very reluctantly - broke it. They had to to get a language
that was consistent, efficient, and sufficiently portable. They broke it by
requiring that a varadic function, such as printf, had to be declared before
it was used. Thus, every C programmer had to add

	#include <stdio.h>

to this program (adding 25% in linecount and more than 33% in character count).

Was that a nuiscance? Yes, especially for textbook writers and students.
Did the requirement improve the language to the benefit of the users? Yes.

Amazing how history repeats itself.

Wellcome to the world of:

	#include<iostream>

	int main()
	{
		std::cout << "Hello, world\n";
	}

Soon it will work everywhere. Being a sufferer myself, I too sympatize with
people who have trouble with inconsistent implementations, but as Steve said:
"This too shall pass," and we will all benefit in the slightly longer run.

	- Bjarne

Bjarne Stroustrup, AT&T Labs, http://www.research.att.com/~bs
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



