Temporary variables

V13 v13 at priest.com
Sat Jun 1 19:37:09 EEST 2002


On Saturday 01 June 2002 02:39, Άγγελος Οικονομόπουλος wrote:
> On Friday 31 May 2002 13:47, Αναστασάτος Βασίλειος wrote:
> > Άγγελος Οικονομόπουλος wrote:
> > > Avoid temporary variables.
> > >   - The Elements of Programming Style (Kernighan & Plaugher)
> >
> > Γιατί;  Πώς;
>
> i) 3exases to [FLAME BAIT] sto subject
>
> ii) apo kati pou eftia3a prosfata:
>
> a=(struct apple *)((unsigned char *)&(orange->lemon)+KILOS);
>
> elpizw na katalabes pia einai h gnwmh[0] mou gia tis tmp vars :-)
>
> [0] einai polu xrhsimes otan kati einai adunato na ginei diaforetika,
> px tmp=a; a=b; b=tmp;

Apo tin empeiria moy... ena:

int k,l;

k=koko();
lala(k);
l=papa();
tata(l);

einai poly poio 'apodotiko' apo ena:

lala(koko());
tata(papa());

otan to programma soy einai 20384692834690258(arketes) seires kai ksafnika, 
meta apo 10 meres poy trexei soy petaei core[1] kai psaxneis na breis ti 
ftaiei... Ta stoixeia poy yparxoyn stis axristes aytes metablites m'exoyn 
glitosei apo polles ores psaksimo, mia kai mporeis mexri ena simeio na 
katalabeis ti egine ta teleytaia X nanoseconds (kati poy den fenetai me ena 
aplo backtrace)

Aloste stis perisoteres periptoseis ayto exei oysia mono an to kaneis compile 
me -O0.. apo -O1 kai pano (an thymamai kala), oles aytes oi metablites 
eksafanizontai, opote einai san na min tis ebales.

[1] Sto paradeigma ayto to core symbenei meta apo tin epistrofi apo tin 
tata(), se kapoio simeio stin idia synartisi me ton parapano kodika.

<<V13>>



More information about the Linux-greek-users mailing list