There are plenty of reasons to include code, and issues like variable 
assignment should be able to be addressed with minimal care as to scope of the 
variables --> if you use "I" in a for/next loop and include or execute some 
code in the loop that also uses "I", U will get what you deserve.

As per other recent discussions, I'd run the includes through a pre-processor 
so that the object you ultimately produce DOES NOT have includes, but rather 
has real code, and real line number references, that can be used against the 
pre-processed source code

You can get the same level of re-use from included code as you can from calling 
external subroutines with appropriate code builds, and the speed gains can be 
significant from, inline code, though sometimes this can be counter-intuitive 
if a highly used routine spans frame boundaries & frame faults (though few 
people will bother looking at code for this level of optimization within the 
runtime environment

Ross Ferris
Stamina Software
Visage > Better by Design!

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Baker Hughes
Sent: Wednesday, 8 February 2012 10:05 AM
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