Baker, In production at my current site I have used Include only once, but for reasons very different from what has already been discussed. I have a Shipment print program customized into a true monster. It had not been rolled forward during previous vendor (Dataflo) upgrades because of the difficulty.
I bit the bullet. Internally smaller custom sections with limited variable requirements I pushed into subroutines. These were low-usage code sections so I was not concerned with performance. The bulk of the customizations were in huge blocks of heavily exercised code. I did not what to put those into subroutines for performance reasons, and because the variable usage was huge and tangled. I collected those large blocks and moved them to the bottom of the program as internal gosubs. My final step was to use the vendor's COMPARE tool to confirm I did break baseline functionality. This forced a major refractor of internal custom structure and major cleanup of comment tags and project references. Now when the COMPARE tools runs I can rapidly confirm correct modification of the vendor's code. This sets up the program to be upgrade-able in the future. I finally pushed the massive custom block I placed at the end of the program into an Include. Now when I run the COMPARE tool it reaches the end of the program where there is now one custom Include and Done! My reason is that simple. I have had to debug only a couple of times. I simply comment out the Include and Load the entire Include code into place, compiled, and debug. Cumbersome yes, fortunately not a daily procedure. ;-) Marc Rutherford Principal Programmer Analyst Advanced Bionics LLC 661) 362 1754 -----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 3:05 PM To: U2 Users List (email@example.com) 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