Re: learning dragonfly or C...

看板DFBSD_kernel作者時間21年前 (2004/11/12 09:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串13/23 (看更多)
Matthew Dillon <dillon@apollo.backplane.com> 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闣. www.kirilla.com
文章代碼(AID): #11b0jL00 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11b0jL00 (DFBSD_kernel)