|
> From: Seth.D.Shields@xxxxxxxx > > I didn't say anything about converting existing code. I'm talking about > new code. All the same issues apply: single-page procedures, two to three levels of nesting. It's in all the literature <smile>. Kidding aside, I don't think there's anybody out there who recommends 500-line procedures. > My programs are very structured following all of the afore mentioned > structured programming practices. Please don't assume > otherwise. "Structured" and "maintainable" aren't necessarily synonymous, and after many years I've come to the conclusion that the only good code is maintainable code. And note that I'm not implying that your code is not maintainable! Just that I've found that 500-line procedures are inherently less maintainable than shorter ones. > With that said, I do have structured programs that are 500 lines long. > Even with one and two levels of nesting and yes, "sometimes" > three, I feel it is much more readable. We're getting into the fuzzy area of "programming style" here. Like I said my last post to Mike, it's all about maintainability. The reason I don't like long procedures is because I'm old and I lose context easily <grin>. Seriously, if I have to flip through seven pages of code to see the end of a programming construct, it's hard to maintain, IN MY OPINION, no matter how nicely you indent it. I should always be able to see an entire construct on a single page. That's one of the very nice things about the PC-based editors - the screen page has been extended to 50 lines or so. But that's necessary now that RPG is using longer field names and multiple-line statements. Of course, this is a "convention", not a rule, and in exceptional circumstances it needs to be broken. But if you regularly write 500-line mainlines or procedures, then I think that I would find your code a little harder to maintain than that of someone who likes to stick with 40 or 50 line (or 4 or 5 line) procedures. Joe
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.