Newsgroups: comp.sys.amiga.advocacy
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!wuarchive!uunet!sugar!peter
From: peter@sugar.hackercorp.com (Peter da Silva)
Subject: Re:    8-bit death
Message-ID: <1991May30.144817.23494@sugar.hackercorp.com>
Organization: Sugar Land Unix -- Houston, TX
References: <mykes.2906@amiga0.SF-Bay.ORG> <1991May27.130057.27121@sugar.hackercorp.com> <mykes.2950@amiga0.SF-Bay.ORG>
Date: Thu, 30 May 1991 14:48:17 GMT

In article <mykes.2950@amiga0.SF-Bay.ORG> mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes:
> Sorry, but I use Matt Dillon's DNews, which doesn't allow me to quote from one
> article while responding to another.

I'm talking about the article you were responding to.

> Please trust that I had no intention of
> being clever :)  Your article in csa.programmer shows clearly the problems of
> porting between two compilers - especially if it's not your code and if it wasn't
> crafted for portability.

Eliding the word "especially", I'd agree. If the code wasn't written for
portability you lose. If it was, C gives you a chance at writing code that
will run after simply recompiling. Assembly doesn't.

That's enough for me.

> ...the language doesn't do a thing to promote portable programming practices

Sure it does. It provides all the tools you need to hide implementation
details in modules and opaque data structures, to separate system dependent
modules from the portable code of the program.

> (consider the use of the FAR, NEAR, HUGE, etc. keywords for PC compilers...).

I write code on the 80286 every day at work, and I haven't used any of these
keywords yet. Microsoft was completely wrong in implementing them in their
compiler, and you can't lay the blame for that on the design of C. They are
neither necessary nor desirable.

> Do you think it's easy to port between 32-bit int compilers and 16-bit int
> compilers?

Yes. I do it all the time. I port code from 32-bit UNIX compilers to 16
bit UNIX compilers and Manx in both 16- and 32- bit mode. I have lots of
UNIX utilities running on my machine... it's *easier* to do that than to
port from Lattice to Manx in many cases, because UNIX programmers live in
an environment where portability is encouraged. Too many Amiga programmers
are ex-C=64 people.

> Your practice of writing "DisplayImage" the way you do is good for
> portability, but hurts your programs' performance, speed wise.

Why? If the call overhead becomes a problem I can always inline it, either
by converting it to a macro or by using one of the inlining preprocessors
that are floating around.

> I personally don't criticize you for choosing "portabilty" over speed,

Take out those quotes. Portability is a real consideration, even within a
single line of computers.

> nor would I criticize someone for choosing speed over portability.

I would, if they were expending energy on useless micro optimisation. You
might need that extra millisecond in Blazemonger, but writing editors and
the like in assembly is just asking for trouble.
-- 
Peter da Silva.   `-_-'
<peter@sugar.hackercorp.com>.
