× 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 2011/6/29 10:11 PM, John Yeung wrote:
... I've always gotten
an icky feeling with /copy, but I suppose it's no worse than
#include-ing C header files. (Not that I'm too happy with #include.)
It's yet another place where the program is scattered about, another
piece to maintain. We'll see how it goes.


I've heard others have icky feelings about /copy, and I think it usually stems from disliking the practice of copying in calculations.

But /copy is very useful for defining constants, data structures, prototypes etc, anything that should be defined the same everywhere.

For example, say you have some action codes: 'DEL', 'ADD', 'UPD'. All your programs can just code those literals, but if someone codes 'DLT' by mistake, things won't work well.

Instead, you could these constants in a /copy file, and then never code the literals again. Then if someone codes ACTION_DLT by mistake, the compiler will catch it.

D ACTION_DEL C 'DEL'
D ACTION_ADD C 'ADD'
D ACTION_UPD C 'UPD'

Again, it's a bit more work to set it up, and maybe a bit more work to add a new action code than just to start using the new 'XYZ' code, but you save time in the long run, both in coding and maintenance.

(Hoping I'm not pressing my luck "lecturing" you again so soon, John, but you raised another interesting topic.)

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.