John Bruner jdb at mordor.UUCP
Wed Dec 4 10:52:21 AEST 1985

>>> Are you saying you want to write different programs to accomplish the
>>> same thing on all these machines?
>> Why not?  Is that too idealistic or something?
>No, it's just too much (silly, unnecessary) work.

The biggest difficulty that I see with regard to writing portable
programs for many different window environments is the diverse system
interfaces involved.

I have always tried to code in a portable fashion (even to the extent
that I still consider some factors which many people have long abandoned,
like the number of significant characters in variable names).  It isn't
difficult to write a large number of useful programs in C which operate
in a tty or "glass tty" environment.  The standard I/O library is a
useful common denominator (although not as common as it once was,
unless you resist the temptation to use any of the enhancements
that have been added in some implementations).

I have no idea how to approach the corresponding task in a bit-mapped
display environment.  The user interfaces of two machines I use
frequently -- a Sun and a Macintosh -- are significantly different.
I haven't written window-oriented programs for the Sun, but I would
expect its program interface to be significantly different from
the Macintosh's Toolbox.

The Macintosh event-driven interface has a significant impact upon
the design of Macintosh software.  (At least, it has an impact upon
software that is designed to follow the Macintosh user interface
guidelines.)  I would expect the interfaces on the Amiga, Atari ST,
IBM PC, Sun, BLIT, to have a similar effect on programs.  It isn't
clear to me how to encapsulate system-dependent code so that a
program could be easily ported from -- say -- curses on an Ann Arbor
Ambassador to a Macintosh.  There is no stdio-like common
denominator for this sort of environment.  Going the opposite
direction is even harder (I notice, for instance, that "dbxtool"
only runs under Suntools, although one could conceive of an
implementation for cursor-addressible terminals).

I do agree with the stated goal that programs should be portable.
It just isn't clear to me how to accomplish this when the output
device isn't constrained to be compatible with a printing terminal
or (perhaps) cursor-addressible CRT.
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  MILNET: jdb at mordor [jdb at s1-c.ARPA]	(415) 422-0758
  UUCP: ...!ucbvax!dual!mordor!jdb 	...!seismo!mordor!jdb

More information about the Comp.lang.c mailing list