spare us please. I think the posters were referring to days gone by AND coding closer to the machine. Have a look at most any assembler language, you'll find things like jumps (goto's in disguise).
Don Kibbey Financial Systems Manager Finnegan, Henderson, Farabow, Garrett & Dunner LLP >>> [EMAIL PROTECTED] 12/29/04 08:37AM >>> I'm an elder too...so I will be kind to myself.. alas...everyone missed my point.. Personally...and I mean personally, even if I hoards behind me who feel the same way...I think GO, & GOTO's are sloppy coding. There are cleaner ways to do it. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bruce Nichol Sent: Tuesday, December 28, 2004 9:33 PM To: [email protected] Subject: RE: [U2] LOOP or GOTO on READNEXT Goo'day, At 19:30 28/12/04 -0500, you wrote: >It is a silly argument... > >I just think about utilizing a goto or its facsmile within C++. C, C# (not >that I ever did) and it would quickly garner a big red "F" in school... Ah! But some of us were programming "top down" with GO's, JUMP's, what-have-you - quite productively and successfully - long before "structured programming" was foisted upon an unsuspecting public, and long before "schools" of any ilk, primary, secondary or tertiary, even knew a skerrick about "programming" per se. Most of the programming profession in those days, and it's well and truly within my lifetime, were taught their trade by hardware manufacturers..... As a matter of small fact, "top down" programming was preached at me in my early Pick days (late 70's) to overcome frame faulting/ response time problems in MDD boxes with only 32K of memory and up to 8 users.... Be kind to your elders..... >I don't know of any other language where it would even get beyond a snicker >at the unpolished newbie... > >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of >[EMAIL PROTECTED] >Sent: Tuesday, December 28, 2004 5:27 PM >To: [email protected] >Subject: RE: [U2] LOOP or GOTO on READNEXT > > >While quibbling over nanoseconds, some of may have missed a little flaw >in your tests that would have nothing to do with caching or memory >allocation. The elapsed time of each test could have been different >enough that the differences in the counts would fall within that margin >of error. This is particularly noticeable in Tom's test below. > >Using 'TIME() + <some.number>' to determine the stopping point could >make the first iteration up to .999 seconds shorter than the second. >When you're processing hundreds of thousands or millions of iterations >per second, that fraction of a second could account for the differences. > >Using Tom's example below, if the system time was 10000.999 at the >start, then >ETIME for the first pass would be 10005, resulting in 4.001 seconds of >processing. The second pass would start around 10005.001 and ETIME >would be 10010, resulting in 4.999 seconds of processing. When >processing 600,000 iterations, that means a margin of error of 120,000. >Hence the results are skewed toward the second loop. > >To get around this, you could: >A) Use SYSTEM(12)(on UD) to get milliseconds or other function to get a >more exact measurement of time to make margin of error smaller. >B) Add some code at the beginning to ensure TIME() had just incremented >to the next number before starting a loop. >C) Loop for more than a few seconds to make the partial second a smaller >part of the total. >D) Loop for a fixed number of times, logging starting and ending times >(preferably in milliseconds or smaller). > >Dean > >P.S. I apologize for the late post. I'm once again way behind but >couldn't resist this one. > > >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of >[EMAIL PROTECTED] >Sent: Monday, December 13, 2004 2:32 PM >To: [email protected] >Subject: RE: [U2] LOOP or GOTO on READNEXT > >Allen E. Elwood <[EMAIL PROTECTED]> wrote on 13 Dec 2004 09:36:42 >-0800 > > > I didn't include the delete statement because what you really wanted > > to test was the LOOP/REPEAT vs. the GO construct. Guess what? After > > doing four consecutive runs and picking the fastest of each four, > > LOOP/REPEAT wins!!!!!! > > ... > > So does this end the GOTO holy war? > > Less Filling, Tastes Better, Goes Faster??? > > ;-) > >Ummm... no. Using UniData 6.0 on AIX 5.1 I tested a similar program >with a tighter GOTO loop: > >01: * Test Loop Speeds >02: * >03: CTR = 0 >04: ETIME = TIME() + 5 >05: LOOP WHILE TIME() < ETIME DO >06: CTR += 1 >07: REPEAT >08: PRINT "While ":CTR >09: * >10: CTR = 0 >11: ETIME = TIME() + 5 >12: 10 CTR += 1 >13: IF TIME() < ETIME THEN GOTO 10 >14: PRINT "Go To ":CTR > >I also wrote a separate program with lines 2-9 above after line 14, so I >could test if the order of execution made a difference. I ran each >program four times, with the following results ("W" indicates "Winner" >:->) > >------ Go To First ----- ------ While First ----- >Go To Count While Count Go To Count While Count >----------- ----------- ----------- ----------- > 769730 W 752380 667050 W 458545 > 655809 734709 W 747373 W 592827 > 576565 688953 W 785676 W 611628 > 629807 748265 W 714679 W 564908 > >The second loop for whatever reason seems to have an advantage. >Overall, I suspect there isn't a lot of difference. > >--Tom Pellitieri > Century Equipment >------- >u2-users mailing list >[email protected] >To unsubscribe please visit http://listserver.u2ug.org/ >------- >u2-users mailing list >[email protected] >To unsubscribe please visit http://listserver.u2ug.org/ >------- >u2-users mailing list >[email protected] >To unsubscribe please visit http://listserver.u2ug.org/ > > >-- >No virus found in this incoming message. >Checked by AVG Anti-Virus. >Version: 7.0.290 / Virus Database: 265.6.5 - Release Date: 26/12/04 > > > > >-- >No virus found in this incoming message. >Checked by AVG Anti-Virus. >Version: 7.0.290 / Virus Database: 265.6.5 - Release Date: 26/12/04 Regards, Bruce Nichol Talon Computer Services ALBURY NSW 2640 Australia http://www.taloncs.com.au Tel: +61 (0)411149636 Fax: +61 (0)260232119 If it ain't broke, fix it till it is! -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.290 / Virus Database: 265.6.5 - Release Date: 26/12/04 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.290 / Virus Database: 265.6.5 - Release Date: 26/12/04 ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
