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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-ArrivalTime: 2001-06-07 21:38:13 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.rsm1.occa.home.com.POSTED!not-for-mail Message-ID: <3B2056A5.86396F55@home.com> From: "Donald L. Dobbs" X-Mailer: Mozilla 4.77 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml Subject: Re: Long names are doom ? References: <3B0DBD4A.82943473@my-deja.net> <3B0DD011.88FCD00E@acm.org> <83WP6.3874$yc6.728572@news.xtra.co.nz> <3B1411D0.3AAF42E7@ftw.rsc.raytheon.com> <9f2nks$ibd$0@dosa.alt.net> <3B177EF7.2A2470F4@facilnet.es> <9f8b7b$h0e$1@nh.pace.co.uk> <9f8r0i$lu3$1@nh.pace.co.uk> <3b1ee2d5$2$fuzhry$mr2ice@va.news.verio.net> <3b20009c$2@news.tce.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 08 Jun 2001 04:38:09 GMT NNTP-Posting-Host: 24.21.61.2 X-Complaints-To: abuse@home.net X-Trace: news1.rsm1.occa.home.com 991975089 24.21.61.2 (Thu, 07 Jun 2001 21:38:09 PDT) NNTP-Posting-Date: Thu, 07 Jun 2001 21:38:09 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:8384 comp.lang.awk:2882 comp.lang.clarion:21397 comp.lang.java.programmer:74619 comp.lang.pl1:888 comp.lang.vrml:3626 Date: 2001-06-08T04:38:09+00:00 List-Id: Dale King wrote: > > "Shmuel (Seymour J.) Metz" wrote in > message news:3b1ee2d5$2$fuzhry$mr2ice@va.news.verio.net... > > >The first example is terse, but not necessarily cryptic as long as > > >you don't try to be terse for the sake of being terse. A bad > > >example of being terse would be: > > > > >if (*i++ < ++j) *k++; > > > > I hate, loathe and despise C, yet I still find that code to be > > perfectly understandable, with the exception of the variable names.. > > Actually it is quite cryptic. The first question is why is k being =============== Here is some C code I had to contend with -- it adds a new dimension to cryptic write-only code: x=(--(p)->_cnt>=0?(*(p)->_ptr++=x)&0xff:_flsbuf(x&0xff,p)) Unless you were the original programmer of the above you don't have a prayer on this one without some additional commentary somewhere... =============== > dereferenced and the value thrown away? Unless it is reading from some > memory mapped I/O device where the actual act of reading is important then > the dereference can be gotten rid of. If this were not true, this would > still be bad, because the compiler might optimize it away. > > Wouldn't the following be more readable (keeping the bad variable names > since I don't know what the purpose of this code is)? It would certainlybe > much easier to step through this code and figure out what it is doing. And > yes I realize that this version does reorder some of the steps (such as i is > not incremented until after k is incremented, but if you have those sort of > constraints they should be spelled out and made explicit. > > j ++; > > if( *i < j ) > { > k++; > } > > i++; > -- > Dale King