DragonFly BSD
DragonFly kernel List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: learning dragonfly or C...


From: "Jonas Sundström" <jonas@xxxxxxxxxxx>
Date: Fri, 12 Nov 2004 01:28:46 +0100 CET

Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:
> :>	struct fubar * blah;
> :>	struct fubar *nblah;
> :>
> :>	getmafubar(&nblah);
> :>	blah = nblah;
 ...
>     Nope.  Ok, I'll tell you... it's so the compiler can 
>     optimize 'blah' into a register.

Cool discussion, though this a much later issue for
most coders, let alone those just starting to learn C.

Random link:
http://c2.com/cgi/wiki?PrematureOptimization

One part of programming that could use a lot more effort is writing 
readable code, so that it actually makes sense to someone not familiar 
with it. (Or one self, a week later.) Choosing descriptive names for 
variables as opposed to names 1 or 2 chars long does a lot for 
readability. (Not meant as criticism of any code shared here.)

Another random link:
"Best practices for programming in C"
http://www-106.ibm.com/developerworks/eserver/articles/hook_duttaC.html?ca=dgr-lnxw03BestC

Another one:  
"Comments on Comments"
http://www.embedded.com/story/OEG20020221S0084

BTW, do long/short variable names matter at all for performance in C 
and C++? And what about function- and class method names?

/Jonas Sundström.                    www.kirilla.com




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]