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: fac41,af40e09e753872c X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,f292779560fb8442 X-Google-Attributes: gid109fba,public X-Google-Thread: f8c65,30e368bdb3310fe5 X-Google-Attributes: gidf8c65,public X-Google-Thread: 1008e3,30e368bdb3310fe5 X-Google-Attributes: gid1008e3,public X-Google-Thread: 1014db,30e368bdb3310fe5 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,30e368bdb3310fe5 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,30e368bdb3310fe5 X-Google-Attributes: gid10db24,public From: cwr@cts.com (Will Rose) Subject: Re: Hungarian notation Date: 1996/05/31 Message-ID: <4om4km$est@news3.cts.com>#1/1 X-Deja-AN: 157684059 references: <31999F43.41C67EA6@scn.de> <4o07o9$rfu@seagoon.newcastle.edu.au> <4o1vo3$p2a@news1.ni.net> <4oehnp$onn@goanna.cs.rmit.EDU.AU> organization: CTS Network Services (CTSNET), San Diego, CA followup-to: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.edu,comp.lang.eiffel Date: 1996-05-31T00:00:00+00:00 List-Id: Richard A. O'Keefe (ok@goanna.cs.rmit.EDU.AU) wrote: : bobduff@world.std.com (Robert A Duff) writes: : >P.P.S. My take on comments is: Comment (only) where necessary. Whenever : >you can express some fact in the programming language, it's better to do : >that than to write a comment. : I like reducing things to slogans. : I haven't been able to come up with a good one for this. : What I say is : "Your comments should tell a human reader precisely the : things s/he needs to understand the purpose and operation : of the module but are not obvious from the code." : This is the right stuff, but it needs to be said better. : Can anyone come up with a really memorable way of expressing this? "Comment at one level above the code" - trouble is, this is a bit cryptic and needs a comment to explain it... : >Any time you feel the need to write a : >comment, that's a failure of the programming language -- it can't : >express what you need to say. : I don't know that I agree with this. How can the code make it clear : why you chose *not* to do something? How does the code describe : the space of possible tradeoffs from which you selected this particular : point and why? I strongly disagree with the 'failure of the language' argument; I tend to write comments at an intermediate level between the code and the reader. Obviously the code is written as clearly as possible, since I have to debug it, but above that level it's handy to have reminders of just what in the world is going on in a broader sense, and why. The next level above comments is probably the manual, but that seldom gets written. Will cwr@crash.cts.com