Re: Article on Herbert Schildt, author of C Unleashed, repaired on wikipedia



On Sat, 12 Jan 2008 06:12:03 -0600, gw7rib@xxxxxxx wrote
(in article
<1b3db33e-e4ef-4dac-9de6-841a6d092207@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>):

On 9 Jan, 23:59, Phlip <phlip2...@xxxxxxxxx> wrote:
gw7...@xxxxxxx wrote:
It's been a while, but I suspect we mean printf _won't_ flush its line
_unless_
<stdio.h> sees a \n on the end of its string.

A quick test shows it working fine in DOS. Prints the prompt, then
asks for input.

(Are you channeling Herb S now?;)

If by "DOS" you mean the Command Prompt in WindowsXP, that follows the same
console model as DOS Classic. On a Unix terminal, such as Linux's BASH, you
might get different "turnaround". Or you might not! Thanks for doing the
experiment, but you can never judge well-behaved programs just by
experimenting!

I think we're talking at cross purposes here. I took your comment (at
the top of this post) to mean that printf was guaranteed not to print
its output unless it came across a \n. This was contrary to how I
remembered it working under DOS, and a quick test (admittedly this
time under the Windows XP command prompt, as you guessed correctly)
bore this out. Of course this is no guarantee that it will work the
same way on different systems (or even the same system) but it refutes
what I thought you'd said.

The problem is that using what DOS or Windows "does" to extrapolate
what will happen everywhere isn't that useful. In fact, it has let a
great many programmers into making assumptions that turn out not to be
true in general.

A lot of Windows programmers that have moved to Linux, OS X, and other
lesser known platforms have been struck by the sudden realization that
code that "just worked" under MS platforms didn't work anymore.

Of course, after getting the appropriate changes in, they wind up with
code that will work on all the platforms, including Windows. If they
had been exposed to multiple platforms when they were first starting
out, some of those lessons would have come naturally, instead of having
to unlearn habits that were only valid with MS compilers and libraries.


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.



Relevant Pages

  • Re: A2Central News
    ... It's good to see that you'd like to see apps ported to other platforms. ... Do you not realize that there's loads of Windows programmers who are the ... Maybe us Mac users tend to be like that because there's a goodly portion ...
    (comp.sys.apple2)
  • Re: A2Central News
    ... It's good to see that you'd like to see apps ported to other platforms. ... Do you not realize that there's loads of Windows programmers who are the ... Maybe us Mac users tend to be like that because there's a goodly portion ...
    (comp.sys.apple2)
  • Re: Need to know
    ... DOS, like Windows is an operating system. ... back some while now it was necessary for programmers to specify not only ...
    (microsoft.public.windowsxp.newusers)
  • Re: StrongForth 1.4 supports OOP
    ... every Windows PC. ... Most programmers today want a 32-bit language. ... I'm surprised that this is only for DOS. ...
    (comp.lang.forth)
  • Re: C# and VB.Net?
    ... ROM chip that shipped with the IBM PC, under every version of DOS and ... Windows. ... programmers will be better programmers in the long run if they learn ...
    (microsoft.public.dotnet.languages.csharp)