delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/08/09:56:53

Sender: crough45 AT amc DOT de
Message-Id: <97Aug8.155313gmt+0100.17058@internet01.amc.de>
Date: Fri, 8 Aug 1997 14:55:36 +0100
From: Chris Croughton <crough45 AT amc DOT de>
Mime-Version: 1.0
To: gareth AT davies DOT discovery-net DOT co DOT uk
Cc: djgpp AT delorie DOT com
Subject: Re: Check out my demo game!

Gareth Davies wrote:

> One other point. I would be interested in everyone's opinion of Allegro. I
> can't actually use it because I use Watcom, but is it really sensible to
> use this library (as good as it might be). Aren't people missing out on the
> learning experience which would otherwise be gained by doing these things
> yourself ???

You're using a compiler.  Aren't you missing out on the learning
experience you could gain by writing it yourself?

You're using the standard C library.  Couldn't you learn more by
writing your own?

I don't see any difference between those questions and the one you
asked.  Yes, you could learn more by doing it yourself possibly,
by putting in the same time or more that Shawn (and in my examples,
the teams who wrote the compilers and standard libraries) took to
do it, but by the time you've done that you could have written 
something more original.

Reinventing the wheel is only a good idea if you can (a) invent a 
better version, or (b) it takes less time to reinvent than to learn
to use the existing one.  For instance, I have 'reinvented' several
library functions (an example is splitting a filename into drive,
path, name and extension) because the systems I was using weren't 
consistent in providing them (different names or not there at all)
and I wanted something portable.  Things like graphics I know
little about, and have no desire to spend a year or so learning
about the intricacies of PC hardware when thee are othe people who
can do it far better than myself.

> (I know you get the source, but if you don't understand it, you 
> can't optimise it). 

True, but you don't have to have written something to understand 
it.  I'm a freelance programmer, which meant that I frequently
have to take over things which other people have written, and
find and solve bugs, make enhancements and optimisations, etc. 
I would be in big trouble if I insisted on rewriting everything.

And you can often learn more from other people's code.  When I
looked at the Allegro code for playing MIDI files, for instance,
I found more about the hardware than I previously knew.  If I'd
rewritten it without that example, my code would have been less
efficient.  The same often with looking at other library source
(have a look at the DJGPP library source sometime, there are
things which I can learn from some of that still, and I've been
programming for over 20 years).

And there's actually a possibility that I might write a program
with graphics on the PC sometime, thanks to Allegro, which I 
wouldn't have done at all had I had to write it from scratch.
I don't have the time...

Chris C

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019