× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Buck Calabro wrote:

If the code is ugly already, adding /free and /end-free aren't going to make
it any uglier in my opinion. But I typically add a subprocedure, which can
lead to a jarring
C EMPID COMP 20001 20 20 C 20EMPID COMP 29999 2020 C N20 GOTO BADMGR c if isManager(empID) = FALSE c goto badmgr c endif
but is it worse than
c/free if (isManager(empID) = TRUE) and
empID >= 20001 and empID <= 29999;
exsr processManager;
endif; /end-free
It sure as heck is a good marker telling me that "I've made changes here!"
But it does beg the question as to whether this furor over mixing styles is
much ado about little. I mean, nobody is going to propose (with a straight
face) that I continue to use the indicator-style of code because that's
what's there already. Right?
Far as I'm conerned, example 2 is the easier to read. But I must say that coding a stinky subprocedure every time I want to insert some free-format code does put me off a bit. As Barbara indicated, it's swings and roundabouts; there isn't a clear rule of thumb as to how one should mix (or allow mixing) of /Free and fixed. (Don't think I like that name. Makes me think of having the cat snipped.)

The ONE place I really despise using /Free is with SQL. The damn /Free /End-Free /Exec SQL /End-Exec preprocessor tags make me go BLIND. I wish the folks at IBM would allow unrestricted mixing of /Free and SQL.

The other thing I don't really know if anyone's mentioned is that /Free actually makes RPG readable by non-RPG programmers. Yeah, it sorta breaks the seal on the club. One of the UNIX/C C++ guys I work with here got VERY excited when he saw the /Free examples I've written for my current client because he didn't have to get the Rosetta stone out to read the code. So if I get hit by bus tomorrow (I'm not planning on it, by the way), he can at least read the stuff I wrote. And if our client hires someone who's got a similar background, they have a shorter learning curve as well.

(This of course assumes my code is readable to begin with.)


-Doc



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.