|
As someone who once worked in the softwarehouse schema, I have to disagree with: > 2) Consumers only need the prototypes. They have no business looking at > the implementation in a properly designed interface. If I'm debugging, I had better be able to see the source code of the modules I'm calling. As a person creating a program with cutting edge technology, exactly why would I want you to be able to see the source code? For that matter why would you want ot be debugging it? That's what customer support is for isn't it? I've had to deal with one too many "in-house" programmers that thought they knew what they were doing in the past, only to cause me headaches and hours of searching through data to correct mistakes they made because they "thought" if I write this program to do this when this program is called, and I put it in my lib list so that it's picked up, then everything will be gravy. Yeah, too bad they didn't know enough to keep an eye on the temperature, because all they'd end up with is a saucepan with thick gunk burned all over the sides. I can see plenty of reason not wanting my source code in the hands of a n00b. I can also see plenty of reason not wanting my source code in the hands of a guru either, for fear that he/she would steal my ideas. Just my two cents. And being Canadian, that's about 1.6 cents US. Hehe. Ron Power Programmer Information Services City Of St. John's, NL P.O. Box 908 St. John's, NL A1C 5M2 Tel: 709-576-8132 Email: rpower@xxxxxxxxxx Website: http://www.stjohns.ca/ ___________________________________________________________________________ Success is going from failure to failure without a loss of enthusiasm. - Sir Winston Churchill "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 03/02/2005 01:58 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Subject RE: Prototyped Procedures > From: Simon Coulter > > Bad idea for a number of reasons. Most of which are opinions (with which I disagree). > 1) The only reason you get away with it is because the code is > in-house. Yep. API sales. This one matters to people who sell APIs. > 2) Consumers only need the prototypes. They have no business looking at > the implementation in a properly designed interface. If I'm debugging, I had better be able to see the source code of the modules I'm calling. > 3) If someone forgets the proper DEFINE they get the source copied into > the program leading to all manner of peculiar behaviour: If someone forgets a semicolon in /free, they get all kinds of peculiar behavior. If someone forgets the "F" in an F-spec, they get all kinds of peculiar behavior. > 4) It's just plain ugly to require the consumer to decide whether they > want the code or not. Eye of the beholder. Personally, I LIKE the fact that all my prototype includes are nicely encapsulated inside a /DEFINE PROTOTYPE and a /UNDEFINE PROTOYPE. > /copy rpgleinc,fbnmath > /copy rpgleinc,fbnstring > /copy rpgleinc,fbndate > > is much cleaner than forcing the consumer to remember to code > /define prototypes > /copy rpgleinc,fbnmath > /copy rpgleinc,fbnstring > /copy rpgleinc,fbndate > /undefine prototypes "much cleaner"? How? > 5) Having a separate define for each prototype name is even uglier. Not sure who brought this up. Not me. On the other hand, there are real reasons to use the /DEFINE PROTOTYPE method. I may want to define an area in the caller and not in the callee. That area may need a predefined layout, such as a data structure. With the use of the /DEFINE, the source member can define the data structure in both places as based, but actually define data for it in the caller: D MyParmDS s based(pMyParmDS) (...) DS Subfield definitions D MyProcedure PR D pDS * /IF DEFINED(PROTOTYPE) DwMyParmDS s like(MyParmDS) DpMyParmDS s * inz(%addr(wMyParmDS)) /EOF /ENDIF In the single include technique, I'd have to hand-code those last two lines. Two lines may not be much, but it gets more involved with more complex structures. Whether you like this technique or dislike it, it can only be done with a single include member. Joe -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.