Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... References: <3298246.85057.14422@kcbbs.gen.nz> Organization: Plethora . Net - More Net, Less Spam! X-Newsreader: trn 4.0-test62 (21 February 1998) From: seebs@plethora.net (Peter Seebach) Lines: 48 Message-ID: Date: Sat, 05 Sep 1998 06:57:32 GMT NNTP-Posting-Host: 205.166.146.8 X-Trace: ptah.visi.com 904978652 205.166.146.8 (Sat, 05 Sep 1998 01:57:32 CDT) NNTP-Posting-Date: Sat, 05 Sep 1998 01:57:32 CDT Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!chippy.visi.com!news-out.visi.com!ptah.visi.com!not-for-mail In article <3298246.85057.14422@kcbbs.gen.nz>, Richard Plinston wrote: >While languages such as C may be able to be made compact it >may be to the point of obscurity. Speaking of which, everyone start on your IOCCC entries. Thanks. >Usually the programmer >is compelled to add comments to explain what is going on, >this taking more space than a similar readable Cobol >statement. "usually". Hmm. I *rarely* find the need to comment code significantly; rather, when I do, it's not the sort of thing that is self-commenting in something like COBOL. >One advantage of 'self documenting' languages is that the >same text is read by the compiler and the next programmer >while when a program is expressed in two seaparate sets >of text: program and comment, there is no assurance that >they are equivalent. If what you're commenting is at the level the compiler is thinking at, you're doing something *VERY* wrong. The worst comments are things like i++; /* increment i */ Would this be clearer if it were ADD ONE TO I ? Perhaps. However, more likely, it would be best as i++; and the comment is completely superfluous. No one should ever be commenting anything that is simply part of the compiler-level meaning of the code. Comments should tell you *WHY*. In other words, i++; /* correct for fencepost error */ might be good, but I bet you can't write ACCOMMODATE FENCEPOST ERROR IN I GIVING I in COBOL. :) -s -- Copyright 1998, All rights reserved. Peter Seebach / seebs@plethora.net C/Unix wizard, Pro-commerce radical, Spam fighter. Boycott Spamazon! Seeking interesting programming projects. Not interested in commuting. Visit my new ISP --- More Net, Less Spam! ###### From: "Michael F. Coyle" Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... Date: Sat, 5 Sep 1998 15:27:58 -0400 Lines: 15 Message-ID: <6ss3ej$9vq$1@winter.news.erols.com> References: <3298246.85057.14422@kcbbs.gen.nz> NNTP-Posting-Host: 207-172-196-35.s35.as3.smt.erols.com X-Trace: winter.news.erols.com 905023763 10234 207.172.196.35 (5 Sep 1998 19:29:23 GMT) X-Complaints-To: abuse@rcn.com X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!howland.erols.net!master.news.rcn.net!not-for-mail Peter Seebach wrote in message ... >The worst comments are things like > i++; /* increment i */ Wouldn't i++; /* decrement i */ be even worse? Incrementally yours, Michael ###### From: spam@orion-com.com (Joe Thompson) Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... Date: Sun, 06 Sep 1998 00:12:54 -0400 Organization: Orion Computer Consulting Lines: 25 Message-ID: References: <3298246.85057.14422@kcbbs.gen.nz> <6ss3ej$9vq$1@winter.news.erols.com> NNTP-Posting-Host: user-37kba9m.dialup.mindspring.com X-Server-Date: 6 Sep 1998 04:08:47 GMT X-Newsreader: MT-NewsWatcher 2.4.4 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!news.maxwell.syr.edu!firehose.mindspring.net!firehose.mindspring.com!spam In article <6ss3ej$9vq$1@winter.news.erols.com>, "Michael F. Coyle" wrote: > Peter Seebach wrote in message ... > > >The worst comments are things like > > i++; /* increment i */ > > Wouldn't > i++; /* decrement i */ > be even worse? Yes it would, and sadly, that's not at all far-fetched. I've seen code where I had to strip out the comments to figure it out; there were many comments where even if the author *intended* to do what he stated in the comments, he utterly failed to do so. In some cases he actually did the right thing, but the comment indicated he apparently meant to do something that would have been horribly wrong. Comments that contradict the code make for negative readability. -- Joe -- Joe Thompson | "Boiling, carbonated coffee." -- Thorfinn spam@orion-com.com | http://kensey.home.mindspring.com/ Charlottesville, VA | O- He-Who-Grinds-the-Unworthy | I have brown eyes AND I VOTE! ###### Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... References: <6ss3ej$9vq$1@winter.news.erols.com> Organization: Plethora . Net - More Net, Less Spam! X-Newsreader: trn 4.0-test62 (21 February 1998) From: seebs@plethora.net (Peter Seebach) Lines: 25 Message-ID: Date: Sun, 06 Sep 1998 04:42:31 GMT NNTP-Posting-Host: 205.166.146.8 X-Trace: ptah.visi.com 905056951 205.166.146.8 (Sat, 05 Sep 1998 23:42:31 CDT) NNTP-Posting-Date: Sat, 05 Sep 1998 23:42:31 CDT Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-peer.gip.net!news.gsl.net!gip.net!news.maxwell.syr.edu!chippy.visi.com!news-out.visi.com!ptah.visi.com!not-for-mail In article , Joe Thompson wrote: >Yes it would, and sadly, that's not at all far-fetched. I've seen code >where I had to strip out the comments to figure it out; there were many >comments where even if the author *intended* to do what he stated in the >comments, he utterly failed to do so. In some cases he actually did the >right thing, but the comment indicated he apparently meant to do something >that would have been horribly wrong. > >Comments that contradict the code make for negative readability. -- Joe Yes. The COBOL guy's point was that, if comments are separate from code, you can have comments disagree with code. My point, in complaining about ++i; /* increment i */ was that comments which naively agree with code, or code which is spelled out, is not necessarily more readable. -s -- Copyright 1998, All rights reserved. Peter Seebach / seebs@plethora.net C/Unix wizard, Pro-commerce radical, Spam fighter. Boycott Spamazon! Seeking interesting programming projects. Not interested in commuting. Visit my new ISP --- More Net, Less Spam! ###### From: Robert Billing Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... Date: Sun, 06 Sep 1998 10:46:17 +0000 Organization: Tanglewood Message-ID: <35F267F9.6F403BFD@tnglwood.demon.co.uk> References: <3298246.85057.14422@kcbbs.gen.nz> <6ss3ej$9vq$1@winter.news.erols.com> NNTP-Posting-Host: localhost.demon.co.uk X-NNTP-Posting-Host: tnglwood.demon.co.uk:158.152.132.30 X-Trace: news.demon.co.uk 905079215 nnrp-07:11782 NO-IDENT tnglwood.demon.co.uk:158.152.132.30 X-Complaints-To: abuse@demon.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.04 (X11; I; Linux 2.0.31 i586) Lines: 22 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news.belnet.be!news-raspail.gip.net!news-lond.gip.net!news.gsl.net!gip.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!tnglwood.demon.co.uk!not-for-mail Michael F. Coyle wrote: > Wouldn't > i++; /* decrement i */ > be even worse? I once found CLR @-76(R4) ; RESET BILL'S FLAG as the *only* comment in a module that was about 300 lines of PDP-11 assembler. As I had no idea who Bill was, and which modules he had written, and R4 was set outside this module, nobody knew where, I did the only thing I could. I screamed. -- I am Robert Billing, Christian, inventor, traveller, cook and animal lover, I live near 0:46W 51:22N. http://www.tnglwood.demon.co.uk/ "Bother," said Pooh, "Eeyore, ready two photon torpedoes and lock phasers on the Heffalump, Piglet, meet me in transporter room three" ###### From: jmfbahciv@aol.com Newsgroups: alt.folklore.computers Subject: Re: YKYBHTL... Date: Sun, 06 Sep 98 11:09:12 GMT Organization: UltraNet Communications, Inc. Lines: 26 Message-ID: <6stugg$e7a$1@ligarius.ultra.net> References: <3298246.85057.14422@kcbbs.gen.nz> <6ss3ej$9vq$1@winter.news.erols.com> <35F267F9.6F403BFD@tnglwood.demon.co.uk> NNTP-Posting-Host: d6.dial-11.mbo.ma.ultra.net X-Complaints-To: abuse@ultra.net X-Ultra-Time: 6 Sep 1998 12:17:20 GMT X-Newsreader: News Xpress Version 1.0 Beta #4 Path: ccw.ch!pfaff.ethz.ch!news-zh.switch.ch!news-ge.switch.ch!newscore.univie.ac.at!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.internetmci.com!209.244.253.199!newsfeed.xcom.net!news.ultranet.com!d6 In article <35F267F9.6F403BFD@tnglwood.demon.co.uk>, Robert Billing wrote: >Michael F. Coyle wrote: > >> Wouldn't >> i++; /* decrement i */ >> be even worse? > > I once found > > CLR @-76(R4) ; RESET BILL'S FLAG > >as the *only* comment in a module that was about 300 lines of PDP-11 >assembler. As I had no idea who Bill was, and which modules he had >written, and R4 was set outside this module, nobody knew where, I did >the only thing I could. > > I screamed. > So that's what that strange sound was :-). If I could hazard a guess, was that a diagnostic? /BAH Sigh! - Subtract a hundred and four for e-mail. ###### [from here on large subthread on k=1000 vs K=1024 snipped]