Re: [U2] Deep and long indentations vs multiple exit points

2007-12-04 Thread David A Barrett
Marco, I see what you're saying, so I went and looked at some code fresh code I've just written. I see that at its deepest, it goes 5 levels deep, which is pretty close to what you've described. I also noticed something else: In the cases where you could use CONTINUE, all of the ENDs are stacke

Re: [U2] Deep and long indentations vs multiple exit points - AD NAUSEUM

2007-12-03 Thread Ray Wurlod
Since AD takes the accusative case, it's AD NAUSEAM (I don't really want to argue JMP instructions, which is all there is once you get to the compiled code.) --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/

Re: [U2] Deep and long indentations vs multiple exit points - AD functionality not bugs

2007-12-03 Thread rbl000
Clif, I appreciated your viewpoint and was glad to see it. I didn't take it that you were singling anyone out, but since I've not sallied forth into the fray, perhaps I was immune from such feelings. Thanks for your contributions as well as those who've made other constructive offerings! Sin

Re: [U2] Deep and long indentations vs multiple exit points - AD functionality not bugs

2007-12-03 Thread Clifton Oliver
Sorry, Stuart. I should have completely trimmed the reply quote on my post so it didn't look (as it apparently did) that I was singling out you as the main target of my comments (after the part about guard clauses). It was more of a sociological musing as to how many times over the years we

Re: [U2] Deep and long indentations vs multiple exit points - AD NAUSEUM

2007-12-03 Thread MAJ Programming
requirements. Others may have home-grown systems from the Jurrasic Pick era. Without comparisons, we all function in a vacuum. My 1 cent Mark Johnson - Original Message - From: "Clifton Oliver" <[EMAIL PROTECTED]> To: Sent: Sunday, December 02, 2007 10:55 PM Subject: Re

Re: [U2] Deep and long indentations vs multiple exit points

2007-12-03 Thread Marco Manyevere
. - Original Message From: David A Barrett <[EMAIL PROTECTED]> To: u2-users@listserver.u2ug.org Sent: Friday, 30 November, 2007 4:03:16 PM Subject: Re: [U2] Deep and long indentations vs multiple exit points Curious, I would have done: LOOP WHILE READNEXT ID READ RECORD FROM FILE,ID THEN

RE: [U2] Deep and long indentations vs multiple exit points - AD functionality not bugs

2007-12-03 Thread Boydell, Stuart
One of the reasons I'm subscribed to the list because I'm interested to see how other people do it their way. I've learnt some valuable stuff here. I think contribution to this topic is valid under the banner of technical discussion. But hey if I'm out of line or if the topic is not applicable here

Re: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread MAJ Programming
d helpers would disappear. Plus, it would be that much more 'wordy' and hard to read quickly. My 1 cent Mark Johnson - Original Message - From: "Trey Miller" <[EMAIL PROTECTED]> To: Sent: Sunday, December 02, 2007 8:43 PM Subject: RE: [U2] Deep and long indentations v

RE: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread Allen E. Elwood
ehalf Of Keith Johnson (DSLWN) Sent: Sunday, December 02, 2007 5:59 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Deep and long indentations vs multiple exit points Dave Barret gave this code as an example: GOSUB OPERATION.1 IF (NOT(ERROR)) THEN GOSUB OPERAT

Re: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread MAJ Programming
<[EMAIL PROTECTED]> To: Sent: Sunday, December 02, 2007 6:58 PM Subject: RE: [U2] Deep and long indentations vs multiple exit points > Dave Barret gave this code as an example: > > GOSUB OPERATION.1 > IF (NOT(ERROR)) THEN > GOSUB OPERATION.2 > IF (NOT(ERROR)) T

Re: [U2] Deep and long indentations vs multiple exit points - AD NAUSEUM

2007-12-02 Thread Clifton Oliver
Perhaps you might want to expand your search criteria to include "the last ten years" and examine the use of Guard Clauses. Does anyone else on the list find these discussions of "style," "good practice," etc. to be both out-of-date and an exercise in wasted bandwidth (not to mention having

RE: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread Trey Miller
, December 02, 2007 5:59 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] Deep and long indentations vs multiple exit points Dave Barret gave this code as an example: GOSUB OPERATION.1 IF (NOT(ERROR)) THEN GOSUB OPERATION.2 IF (NOT(ERROR)) THEN

RE: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread Boydell, Stuart
I'm in complete agreement with the "one way in/out" (OWI-OWO ) rule. Out of interest, I have searched the net and of the many articles I found which cited OWI-OWO, all cited it in the scope of being good practice. I found one which cites "one way in, multiple|many ways out" with a scathing comment.

RE: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread Keith Johnson (DSLWN)
Dave Barret gave this code as an example: GOSUB OPERATION.1 IF (NOT(ERROR)) THEN GOSUB OPERATION.2 IF (NOT(ERROR)) THEN GOSUB OPERATION.3 IF (NOT(ERROR)) THEN GOSUB OPEARTION.4 END END END What

Re: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread MAJ Programming
;Ken Wallis" <[EMAIL PROTECTED]> To: Sent: Sunday, December 02, 2007 5:58 AM Subject: RE: [U2] Deep and long indentations vs multiple exit points > I realise that I've largely been a lurker of late - making a living working > with jBASE pretty much full time now - but I&#

RE: [U2] Deep and long indentations vs multiple exit points

2007-12-02 Thread Ken Wallis
up tight ;^) Cheers, Ken -Original Message- From: Marco Manyevere Sent: Thursday, 29 November 2007 3:18 AM To: u2-users@listserver.u2ug.org Subject: [U2] Deep and long indentations vs multiple exit points There has been a lot said recently about styles, standards and good practic

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread MAJ Programming
use GOTO properly and can mix it with GOSUB and CALL for readable code, I don't use RETURN TO. My 1 cent Mark Johnson - Original Message - From: "Susan Lynch" <[EMAIL PROTECTED]> To: Sent: Friday, November 30, 2007 11:38 AM Subject: Re: [U2] Deep and long indentations v

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread MAJ Programming
ianne Ackerman" <[EMAIL PROTECTED]> To: Sent: Friday, November 30, 2007 10:38 AM Subject: Re: [U2] Deep and long indentations vs multiple exit points > Mark, > Although I usually agree with you, this time I have to disagree. Using > a CASE statement in this way seems a very clear

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread Susan Lynch
Cordage Park Circle, Suite 200 Plymouth, MA 02360-7318 (508) 747-7261 - Original Message - From: "Ray Wurlod" <[EMAIL PROTECTED]> To: Sent: Thursday, November 29, 2007 5:11 PM Subject: Re: [U2] Deep and long indentations vs multiple exit points A third possibility is

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread Dianne Ackerman
Mark, Although I usually agree with you, this time I have to disagree. Using a CASE statement in this way seems a very clear way to handle something, especially when you're checking for a huge number of reasons to "disqualify" something from happening. Have you ever programmed the Federal Fi

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread Charles_Shaffer
>For my money, the CASE statement, sensibly used, is much better than >multiple IF statements Agreed. Let the compiler work it out. Charles Shaffer Senior Analyst NTN-Bower Corporation --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread David A Barrett
Curious, I would have done: LOOP WHILE READNEXT ID READ RECORD FROM FILE,ID THEN IF ((RECORD EQ COND1) AND (RECORD EQ COND2) AND (RECORD EQ COND3)) THEN RECORD = 'PROCESSED' END END REPEAT If I was worried about the IF statement getting too long, then I'd do this: LOOP WHILE RE

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread MAJ Programming
someone coming from another non-MV environment as END IF isn't MV required. I don't even know if it compiles. - Original Message - From: "Colin Jennings" <[EMAIL PROTECTED]> To: Sent: Friday, November 30, 2007 9:36 AM Subject: Re: [U2] Deep and long indentations v

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread Colin Jennings
You could do this. PROCESS.REC: READ RECORD FROM FILE,ID THEN IF RECORD EQ COND1 AND RECORD EQ COND2 AND RECORD EQ COND3 THEN RECORD = 'PROCESSED' WRITE RECORD TO FILE, ID END IF END IF RETURN Or, you could try: READ RECORD FROM FILE,ID THEN BEGIN CASE CASE RE

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-30 Thread Charles_Shaffer
Adrian" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 11/29/2007 05:41 PM Please respond to u2-users To: cc: Subject: RE: [U2] Deep and long indentations vs multiple exit points But this is so much easier to read (note the liberal use of blank line

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread Womack, Adrian
CTED] On Behalf Of Marco Manyevere Sent: Friday, 30 November 2007 1:46 AM To: u2-users@listserver.u2ug.org Subject: Re: [U2] Deep and long indentations vs multiple exit points I had to look up the "CONTINUE" statement. In 25 years I've never used it, and don't even remember

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread Ray Wurlod
A third possibility is to allow GOTO ERROREXIT (single exit point) - or even RETURN TO ERROREXIT - in error handling code. This substantially reduces the number of levels of indentation required. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listse

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread Marco Manyevere
My rule of thumb is that I should be able to see on the same page the structure for IF/END, LOOP/REPEAT, READ/END, FOR/NEXT, etc. Otherwise the block in between becomes a good candidate for a GOSUB. Than see a single case statement that ran across hundreds of lines of code. I've also done stuff l

Re: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread Marco Manyevere
I had to look up the "CONTINUE" statement. In 25 years I've never used it, and don't even remember seeing it used. Now I know what it does I think it should be banned. I use CONTINUE all the time when processing records that must meet multiple conditions in a loop. This way my code doesnt loo

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread Norman Morgan
== Pain is your body's way of saying, "Hey! Stop that!!" === > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Womack, Adrian > Sent: Wednesday, November 28, 2007 5:52 PM > To: u2-users@listserver.u2ug.org > Su

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-29 Thread David A Barrett
I'm very old school and learned my structured programming in PASCAL. The cardinal rule is that you enter every block of code from the top, and you exit it from the bottom. No one ever got hurt doing this. I can only remember one case in recent history where I actually used mulitple exit points.

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Womack, Adrian
I much prefer the multiple exit point method, it makes the code a lot easier to read. Prime examples are when you are looping through a file but only want to process certain records that pass a lot of conditions, it so much easier to test each condition individually and then RETURN immediately. S

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Allen E. Elwood
I try as hard as possible to keep the subr's in the same order as they are called (not always possible with conditions in the calling portion of the program). Therefore someone just reading down the program can get a good feeling for what's happening if that's the way they like to read it. I *def

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Charles_Shaffer
>I've seen programs that have 40 lines of main program code and >99% of them are GOSUBs. That is just a horrible way to design an >application, IMO. That is interesting. I prefer the main routine to be a stack of well named routine or function calls with minimal flow control and no detail. I f

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Glen Batchelor
dnesday, November 28, 2007 12:31 PM > To: u2-users@listserver.u2ug.org > Subject: RE: [U2] Deep and long indentations vs multiple exit points > > Subroutinize, subroutinize, subroutinize > > Flying geese should be avoided whenever possible. Those deep indents

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Allen E. Elwood
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Anthony Youngman Sent: Wednesday, November 28, 2007 08:46 To: 'u2-users@listserver.u2ug.org' Subject: RE: [U2] Deep and long indentations vs multiple exit points I must admit I prefer multiple exit points, but I'll throw a third variant

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Bessel, Karen
28, 2007 10:18 AM To: u2-users@listserver.u2ug.org Subject: [U2] Deep and long indentations vs multiple exit points There has been a lot said recently about styles, standards and good practice and I wonder what your take is on deeply indented routines with a common exit point versus unindented

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread David A. Green
I like only one exit per subroutine. Deeply indented code can be minimized by use of CASE statements and GOSUBs. Thus keeping readability and enhancing maintainability. Thanks, David A. Green www.dagconsulting.com (480) 813-1725 --- u2-users mailing list u2-users@listserver.u2ug.org To unsub

RE: [U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Anthony Youngman
RN Cheers, Wol -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco Manyevere Sent: 28 November 2007 16:18 To: u2-users@listserver.u2ug.org Subject: [U2] Deep and long indentations vs multiple exit points There has been a lot said recently about styles, sta

[U2] Deep and long indentations vs multiple exit points

2007-11-28 Thread Marco Manyevere
There has been a lot said recently about styles, standards and good practice and I wonder what your take is on deeply indented routines with a common exit point versus unindented routines but with multiple exit points. I almost always prefer the later and find it much easier to follow. I come accro