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: 103376,ad988eb0a9545c86 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-17 22:34:56 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!europa.netcrusader.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!nntp1.onemain.com.POSTED!not-for-mail From: "Mike Silva" Newsgroups: comp.lang.ada References: <9b46dr$cd8$1@taliesin.netcom.net.uk> <9b6jtu$4is$2@taliesin.netcom.net.uk> <9b6m27$68e$1@taliesin.netcom.net.uk> <0JBB6.10484$FD1.1197250@news6-win.server.ntlworld.com> <9b7tce$laf$2@taliesin.netcom.net.uk> <3ADC4320.7ACA3DEC@averstar.com> <9bhoup$h9k$1@taliesin.netcom.net.uk> Subject: Re: Problem trying to implement generics. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Tue, 17 Apr 2001 22:34:16 -0700 NNTP-Posting-Host: 209.239.210.151 X-Complaints-To: abuse@onemain.com X-Trace: nntp1.onemain.com 987571867 209.239.210.151 (Wed, 18 Apr 2001 01:31:07 EDT) NNTP-Posting-Date: Wed, 18 Apr 2001 01:31:07 EDT Xref: supernews.google.com comp.lang.ada:6964 Date: 2001-04-17T22:34:16-07:00 List-Id: Just to add another IMO, I've been writing (and debugging!!!) C for over 20 years, and C++ for almost half that time, and I think the for() loop version below is just the kind of gimmick that can make C/C++ code so hard for a programmer-reader to grasp, and if I came across it I'd be sorely tempted to move the function calls (-especially- the assignment to X) out of the for() for readability alone. Mike "Ayende Rahien" wrote in message news:9bhoup$h9k$1@taliesin.netcom.net.uk... > > "Tucker Taft" wrote in message > news:3ADC4320.7ACA3DEC@averstar.com... > > > Interestingly enough, the standard Iterator in Java > > uses: > > while (Iter.hasNext()) { > > X = Iter.next(); > > ... > > } > > > > even though Java has functions with side effects (although > > in fact, only with side-effects on by-reference operands, > > since it has no parameter modes at all!). > > Why use it like this? > for (;Iter.hasNext(); X = Iter.next() ){ > //do stuff > } > > Is much more readable, IMO. > > >