× 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.




On 03/02/2005, at 2:47 AM, <Rick.Chevalier@xxxxxxxxxxxxxxx> wrote:

As a longtime no /copy bigot I'm still coming to terms with using /copy (or /include) for prototypes. I have used the method Joe describes (at least I think it's the same) and I don't see the difference between that and a separate copybook other than using /define statements. I actually kind of like that because then I know exactly what is being copied.

Bad idea for a number of reasons.

1) The only reason you get away with it is because the code is in-house. If you were developing software for resale you would have to provide the prototypes but probably would not want to provide the code. You would have to separate the two.

2) Consumers only need the prototypes. They have no business looking at the implementation in a properly designed interface. Your method allows them to see the guts and possibly make coding decisions based on "how it works now".

3) If someone forgets the proper DEFINE they get the source copied into the program leading to all manner of peculiar behaviour:
a) Errors due to missing prototypes
b) Can result in duplicate definitions and clumsy binding
c) Defeats the point of separating the code into a service program


4) It's just plain ugly to require the consumer to decide whether they want the code or not. It would be marginally better if you put the define around the code rather than the prototypes. That way the default behaviour is to include the prototypes which is what most consumers would want.

/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

/IF prototypename
d Proc       pr
d  parm1                 1a
d  parm2                 10i 0
/ENDIF

5) Having a separate define for each prototype name is even uglier. Why force the consumer to decide which functions they need? If they need one date function they will probably need many of them. Including unused prototypes only slows the compile down a tiny fraction. It has no effect of the compiled object.


/define getdayname
/define getmonthname
/define getdayofweek
/define getdatedifference
/copy rpgleinc,fbndate

is really ugly. And I have to add a new define every time I want to use a new function. Urrk! Just let them include the copy member containing all the prototypes.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



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.