_print/_doprnt; curses on sys III

Kevin S. B. Szabo ksbszabo at wateng.UUCP
Mon Jun 18 15:53:16 AEST 1984


In article <1973 at utcsstat.UUCP> geoff at utcsstat.UUCP (Geoff Collyer) writes:
~| Any program that calls _doprnt (or _print or whatever) directly is
~| *broken*.  The internals of a given stdio implementation are the
~| business of no one but its author(s) and maintainer(s). 

And Dave Sherman replies:
~|Geoff, you would be correct to call such programs "non-portable".
~|I think "broken" is going a little too far. I have some implementations
~|which "work" just fine.
~|sprintf'ing into a buffer isn't always the answer. For one, it
~|requires two or more lines of code for what is conceptually one
~|action.

Dave, I'm sorry but I and many others (I hope), don't agree. The program
implementation is worse that unportable, it is unmaintainable. Sure,
the author can maintain it and will probably continue to keep it humming
perfectly on many systems. But if he/she ever leaves and someone has to
a) fix the code because of an internal, supposedly transparent change to stdio;
or b) port the code to a machine with a totally reworked stdio; the 
maintainer will have to spend many unecessary hours trying to find all the
hidden dependancies on an undocumented internal system routine. Besides, two
lines of code is a small price to pay for clarity, portability and
*maintainability*.

All this from someone who wrote in SP-1 ESS* assembler for a year. Yuck, talk
about un-maintainable.

*SP-1 ESS (Stored Program One, Electronic Switching System. Designed by
Bell-Northern Research circa 1967. All programs in assembler, at least
100-200 thousand lines per version).
-- 
	Kevin Szabo  watmath!wateng!ksbszabo (Elec Eng, U of Waterloo)



More information about the Comp.unix.wizards mailing list