Unnecessary Macros (was Re: Unn

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Wed Sep 28 00:19:00 AEST 1988


>>In article <23 at datcon.UUCP> sar at datcon.co.uk (Simon A Reap) writes:
>>>	z = square(x) + square(y);

>Maybe I'm missing the point, but why does a good old fashion function seem
>to be out of the question.  

I certainly hope you aren't a programmer. The answer is blatently
obvious: calling overhead. Why in the would would anyone ever even
consider writing a function call to perform a single multiplication?
The only possible reason is the IBM mentality: "let's write code so bad
that it runs so slow that the sucker's will have to buy faster iron!".

Actually, one is reduced to using temporaries:

temp1 = fun1();
temp2 = fun2();

z = temp1*temp1 + temp2+temp2; 
and hoping the optimizer removes them. 



More information about the Comp.lang.c mailing list