Re: mu TECH: an unhurried digression on C pointers vs. arrays

From: Miguel Angel (maacruz@navegalia.com)
Date: Sat Apr 29 2000 - 11:35:24 CEST


On Sat, 29 Apr 2000, "Alfie Costa" <agcosta@gis.net> nicely wrote:
> On 28 Apr 2000, at 17:58, Miguel Angel <mulinux@sunsite.auc.dk> wrote:
>
> > I think that worrying of speeding code written in C (or any other high
> > level language) changing such things like arrays for pointers, i=i+1 for
> > i++, ... is completely senseless.
>
> The main point of my previous tale of woe, especially the Allen Holub quote,
> was that such misconceptions can have quite respectable origins. Holub's 'C
...
> book is 13 years old, but K&R is older than that and is still recommended; so
> there was the valid (if unsound) logic that led this way.

You are right. I also have seen this kind of argumentations from many sources.

> No argument here that some speedups are not worth it in the long run. I
> remember about 10-15 years back optimizing my interpreter BASIC code by running
> it through a spaghetti-code optimizer like 'BasicAid'. 'BasicAid' could take a
> nice readable program like:
...
> compiler, these spaghetti programs would run a little faster. 'BasicAid' would
> also shrink variable names, and expand or re-number and re-indent ugly BASIC
> code. An interesting and unlamented program...

The point of my argument was not criticize you at all, but a disertation about
my own mistakes. I haven't understand this thread as some defence of pointers
or arrays, but the exposition of some ideas about some coding extended
(mis)concepts, so this is my intended way of replying, i'm sorry if it was not
clear
I also used this kind of basic code optimizer, and what it was really
worse, i was an expert optimizing code such ways (i even reached the point to
hand code one character basic tokens and machine code with an hex editor). One
colud get some more kb of free memory and a 10% more speed this way.
As i see it with some perspective, it is clear now how much effort one can
waste trying to get a better code from the user's point of view, only to be
obsoleted by the really fast evolution of computer's hardware and software ;-(

Best regards
Miguel Angel

--
Don't see the world trought a window, be open{source}minded, and be free :-)
---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk


This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:14 CET