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: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 11440e,23963231b5359f74 X-Google-Attributes: gid11440e,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-ArrivalTime: 2001-06-05 12:56:08 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-post-01!supernews.com!news.supernews.com!not-for-mail From: Pete Thompson Newsgroups: comp.lang.ruby,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 ? Date: Tue, 05 Jun 2001 12:56:59 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: 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> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ruby:10401 comp.lang.ada:8189 comp.lang.awk:2787 comp.lang.clarion:21142 comp.lang.java.programmer:73808 comp.lang.pl1:781 comp.lang.vrml:3518 Date: 2001-06-05T12:56:59-07:00 List-Id: On Mon, 04 Jun 2001 15:05:12 GMT, Ted Dennison wrote: >In article , Pete Thompson says... >> >>... C/C++ are terse languages. Being terse allows you to >>do more in a shorter period of time. I like using the i++ statement instead of > >Yowch. You lost me right there. Typing in the program is nowhere *near* the most >time-consuming part of developing software. That distinction belongs to the >"getting it to work" phase, along with maintanence in general. The focus needs >to be on doing things that will make those phases go quicker. > >This statement is a perfect illustration of how the ancient design of C >encourages developers to worry about optimizing the wrong things. Back in '72 >when C was designed, the size of a source file was a real issue, and programs >were generally much smaller (and thus simpler to get running). But none of this >is true today. No, that is not what I mean. Yes, it is quite bad to be so terse that the code becomes obfuscated and unreadable (side topic: look up the obfuscated C contest on goodle for a bit of fun). I'm talking about terse in the sense that you get a better picture of the overall picture in a few lines. I'm talking about being terse for the sake of readability, *NOT* for the sake of simply being terse. Consider the following examples: Terse way: for (int i = 0; i < n; i++) { cout << "i = " << i << endl; } Non-terse way: for (int iIterationCounter = ITERATIONSTART; iIterationCounter < iMaximumIteration; iIterationCounter = iIterationCounter + ITERATIONSTEP) { cout << "iIterationCounter = " << endl; } You're going to have to look up the #define's to find out what those constants mean in another file. By design, this is a good thing, actually. However, this can also lead to code that's harder to read once you run into a good chunk of code that spans a couple of pages that really could have been done in half a page and still be just as readable (if not more so because it's all right in front of you). 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 don't want to be forced to think about operator precedence, ok? :) For those of you who are super-picky: I am *NOT* advocating the use of single-character variable names. I (depending on the variable's scope) prefer char* pClientName; instead of: char* p; or char* pNameOfAClientInDatabase; Bottom line: don't be pointlessly terse and don't be pointlessly verbose either. I hope I've explained myself a bit better.