DragonFly kernel List (threaded) for 2004-11
Re: learning dragonfly or C...
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.
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"
"Comments on Comments"
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