In defense of scanf() (Re: Re^2

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Sun Jun 18 01:07:00 AEST 1989


Re:Re:Re:Re:Re:Re:Problems with scanf (and strtok)

I once (and only once!) wrote a "commercial" program. It is for use by
dumb students (well, relatively - they have made it half way through a
Junior level Quantum Mechanics course and survived many 3 dimensional
PDE's, Hermite, Legendre, and Associated Laguerre polynomials and
mathematical induction) and watched them, some of whom, still, in 1985, 
had never touched a computer before. I finally gave up trying to use
ANY canned input routine, and wrote my own that scanned the input
character by character, giving a hopefully appropriate, meaningful,
error message as they typed the offending character (not requiring
a carriage return before giving a message.) 

For programs that only I use, I use scanf all the time.

For programs I buy, I like quick and efficient error messages.
MAybe we need a new acronym: WYDIIWYSI: When you do it is when you
see it! It still bothers me to see a C compiler issue 100 error
messages when the program contains only one bug!

Doug McDonald



More information about the Comp.lang.c mailing list