Should we write internal proc? Just for code readability.

tamhas

ProgressTalk.com Sponsor
MDBA, I think the lever ... though not easily reached ... is a recognition in management that the IT budget is not just an expense like toilet paper or pencils, but that IT has a key role in productivity, competitive advantage, efficiency, ability to tackle certain markets, etc. Once those factors are included in the consideration, the potential cost savings and/or increased revenue potential dwarf the cost of the IT itself.

Rajat, I disagree strongly. Include files obscure code. IPs make it more clear. To be sure, one is getting minimal improvement if one doesn't also use them to control buffer and transaction scope, but I think they naturally promote use for that purpose. Once one has an IP and needs some local variables, then defining local buffers becomes natural.
 
Tamhas, I agree that include files obscure code and IPs are very clear but isn't it time wastage (i think, please confirm) when one procedure (EP) switched to IP then content of EP (current information) is saved to call stack and later retrieved or we should think about this situation (switching time) only when EP calling EP (please suggest).
Yes, if we are defining or taking advantage of local buffer/variable/transaction scope than IPs play an important role.

Thanks!
Rajat.
 
Last edited:

TheMadDBA

Active Member
Please no... include files are one level above shared variables. Do yourself a favor and reconsider.
 

TheMadDBA

Active Member
Rajat - You will never see any real world performance differences using IP. There is no switch like you speak of.

You "might" be able to show a performance difference in a controlled test with no reads or writes from the database, but who has that luxury in the real world?
 

tamhas

ProgressTalk.com Sponsor
Any performance which difference which is detectable in a test that does nothing else is so minuscule as to be negligible. Doing a quick test gives me 0.0000011 seconds per call to an IP.
 
In one of my project, I did use 4 to 5 procedure files (.p programs) for different logic. So, I was suggested that instead of calling EPs from EPs, I should use include file (because of the same reason that I have mentioned). That’s why I thought that if calling EPs from EPs would cause any performance problem then this should be or perhaps applicable to IPs also. Now, I think my understanding for IPs was wrong (I will reconsider that).

Thanks for your valuable inputs!
Rajat.
 

tamhas

ProgressTalk.com Sponsor
Calling a EP does have a start-up overhead. Calling an IP essentially does not. If you run the EP as a PP and then call IPs in the EP, they are very, very close in performance to an IP.

Whole different kettle of fish.
 

TomBascom

Curmudgeon
Using include files is a really bad idea.

In the circa 1987 4gl there were no serious options available.

In today's 4gl you have many options that are much, much better than include files.

Justifying include files "to save switching time" is what is known as pre-mature optimization. It is the root cause of many, many bad architecture decisions. Do not indulge the urge.
 
Top