1000?  I find that hard to swallow on modern systems.  To see that kind of 
difference I suspect it would have to be really memory starved so as to not 
cache it after the 1st use for commonly used routine. And if we're talking 
about a routine that's once in a while, then the benefit doesn't add up to much 
anyway.  I'd love to see some simple benchmarks. I've been surprised before, so 
it could happen. :)
 
We use include for: named commons, a couple common equates (TRUE, FALSE, ASCII 
char names such as ESC, etc), and file dictionaries. To build those we use a 
program that ensures that a prefix is unique to that file, so that variable 
names cannot get crossed.
 
Robert
 
 
Robert F. Porter, MCSE, CCNA, ZCE, OCP-Java
Lead Sr. Programmer / Analyst
Laboratory Information Services
Ochsner Health System
 
 
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.


>>> "David A. Green" <dgr...@dagconsulting.com> 2/8/2012 9:38 AM >>>
When you INCLUDE code during compile time it becomes as one, thus all your
subroutines are now internal subroutines.  And internal subroutines execute
about 1000 times (just guessing here it's been a while since I have done
timing) faster than calling a subroutine.

For debugging, we just had some emails that talked about this very thing.  I
know you need something like -Z2 -D.

David A. Green
(480) 813-1725
DAG Consulting


-----Original Message-----
From: Baker Hughes [mailto:baker.hug...@mouser.com] 
Sent: Wednesday, February 08, 2012 8:15 AM
To: 'dgr...@dagconsulting.com'; 'U2 Users List'
Subject: RE: [U2] Including Code - A Best Practice?

David,

Could you elaborate a little more on your two positive arguments?  Thanks
for your insights, and all those shared from others so far.

Thank you.
-Baker

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David A. Green
Sent: Wednesday, February 08, 2012 8:21 AM
To: 'U2 Users List'
Subject: Re: [U2] Including Code - A Best Practice?

I don't think using an INCLUDE is bad, but it must be done in the right way.

Pros:

* It is the fastest way to use reusable code.
* It can be debugged just fine if you use the correct compile arguments.

Cons:

* You must, MUST, address the variable names. I always prefix mine with
CODE$NAME where CODE is the prefix I've chosen for my INCLUDE and should be
unique for your system.
* You must recompile all instances if you want the change to be updated
everywhere.
* More difficult to edit program logic, unless you have a nice editor that
brings in INCLUDES/INSERTS for you automatically.

David A. Green
(480) 813-1725
DAG Consulting

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Baker Hughes
Sent: Tuesday, February 07, 2012 4:05 PM
To: U2 Users List (u2-users@listserver.u2ug.org)
Subject: [U2] Including Code - A Best Practice?

A friendly discussion arose recently among some U2/MV Developers about
whether to include code.

If any of you have opinions about the positive aspects or negative aspects
of this practice, please respond.  Should it be adopted as a best practice,
or rejected as special situation use only?

Many shops probably include long sections of variable assignments, or
perhaps globally opened files.  This is pretty much accepted everywhere as a
good practice.

In question here is the insertion of actual code - business logic or screen
I/O programs or code snippets.

Maybe you know of methods to overcome some of the obvious downsides:
unintended reassignment of local variables, difficulty in debugging, others.

What are the positive upsides?  Performance gains?

What is the longest snippet you think should be included, if allowed?

What advantage has included code over a CALL or a Function?  Reuse.  What
else?

Can the downsides be mitigated satisfactorily to justify the gains?

Thanks so much.

-Baker

This communication, its contents and any file attachments transmitted with
it are intended solely for the addressee(s) and may contain confidential
proprietary information.
Access by any other party without the express written permission of the
sender is STRICTLY PROHIBITED.
If you have received this communication in error you may not copy,
distribute or use the contents, attachments or information in any way.
Please destroy it and contact the sender.

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org 
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to