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: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-ArrivalTime: 2001-06-07 15:41:53 PST From: "Dale King" Newsgroups: comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml 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> Subject: Re: Long names are doom ? Date: Thu, 7 Jun 2001 10:34:02 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 NNTP-Posting-Host: weis3.indy.tce.com Message-ID: <3b20009c$2@news.tce.com> X-Trace: 7 Jun 2001 17:30:52 -0600, weis3.indy.tce.com Organization: Thomson Consumer Electronics Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!feeder.qis.net!nntp.abs.net!newsfeed.cwix.com!pullfeed!news.tce.com!weis3.indy.tce.com Xref: archiver1.google.com comp.lang.ada:8368 comp.lang.awk:2867 comp.lang.clarion:21370 comp.lang.java.programmer:74541 comp.lang.pl1:874 comp.lang.vrml:3614 Date: 2001-06-07T10:34:02-05:00 List-Id: "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 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