From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11390f,4c42ac518eba0bbe X-Google-Attributes: gid11390f,public X-Google-Thread: 1014db,4c42ac518eba0bbe X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,4c42ac518eba0bbe X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,4c42ac518eba0bbe X-Google-Attributes: gid109fba,public From: firewind Subject: Re: Programming language vote - results Date: 1997/11/20 Message-ID: <65013g$r1a@dfw-ixnews10.ix.netcom.com>#1/1 X-Deja-AN: 291027232 References: <343fbb5a.0@news.iprolink.ch> <34466EB4.3381@dynamite.com.au> <6275dt$agm$3@news.on> <344BCED0.2D51@dynamite.com.au> <62tpap$7gh$1@darla.visi.com> <3470EF6E.F74@lysator.liu.se> <64qsf0$ccc@dfw-ixnews11.ix.netcom.com> <64rvf2$cjn@netra.montana.edu> Organization: Netcom X-NETCOM-Date: Wed Nov 19 6:43:28 PM CST 1997 Newsgroups: comp.lang.ada,comp.lang.apl,comp.lang.c,comp.lang.c++ Date: 1997-11-19T18:43:28-06:00 List-Id: Larry Elmore wrote: > firewind wrote in message <64qsf0$ccc@dfw-ixnews11.ix.netcom.com>... > >I very seldom comment my code at the first writing. I prefer to just code > >and get it done, then go back later and add comments, but -only- to > >code which is not easily understood. > Personally, I find it much easier to write the comments describing what each > procedure/function does _first_ (after doing as much design work as I can > force myself to do -- I don't _like_ doing it, but it sure beats > bug-hunting), with stubs, _then_ adding in the code and whatever few > comments are needed to describe what the code is doing at any point. Leaving > all the commenting to the end makes it seem a bigger, more burdensome job, > especially since the program is already done. I suspect this is one reason > why so many programs out there are so poorly commented... Well, I document my interface first, on paper, (actually, with 'vi' :) then I code the interface, then I comment anything hard to understand -within- the individual functions. (If I know at the time that what I'm coding is confusing, even to myself, I'll comment as I code... this is comparitively rare, however.) > >I find myself using a construct like this a lot recently (snipped directly > >from code I'm working on right now): > > > >if(!to && !(to = malloc(sizeof *to)))) return(NULL); ^ one too many > I _hope_ this isn't really snipped directly from your program, since the > compiler will choke on the parentheses... ;) Whoops, they are indeed unbalanced! Sorry. :) -- [- firewind -] [- email: firewind@metroid.dyn.ml.org (home), firewind@aurdev.com (work) -] [- "You're just jealous because the voices talk to -me-." -] [- Have a good day, and enjoy your C. -] [- (on a crusade of grumpiness where grumpiness is due) -]