Yes, it might be hard coding, but it is hard coded in only one place, thus easy to change. And down the road the routine could be changed to a file lookup if needed.

As is often said of the best approach, "it depends". And if the powers that be don't commonly do much code reuse, you will probably have a hard time convincing them to allow you to "hard code", even if it is only in the one place.

But IMHO, a single callable routine is the way to go. A routine that does one thing, and does it very well. Probably in a service program.

Sam

On 3/24/2010 3:09 AM, David FOXWELL wrote:
-----Message d'origine-----
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Loyd Goodbar

Like Jonathan said, if you can infer the flag, just put that
in a subprocedure and be done with it.


So, if the flag were dependent upon say, the client type, I could have :

clientFlag = getClientFlag ( clientType )

and in getClientFlag :

If clientType = TYPE_THIS....etc
If clientType = TYPE_THAT....etc

But this is seen as 'hard-coding' the client type and seems to be discouraged here. Hence the preference for adding the flag to the client file.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.