Resolved Static or Dynamic

Anderson Clayton

New Member
Hi folks,

I currently began to write my codes dynamicly, i mean, every temp-table, buffer, queries and objects in general, i just create in run time. i've been notice its necessary more lines to do this way, so, my doubt is whats the advantages in dynamic code comparing to static code?
 

Stefan

Well-Known Member
Dynamic code is slower than static code, throws run-time errors instead of compile-time errors and can easily leak memory if you are not cleaning up after yourself.

But, it does allow you to execute actions dynamically so you can have one class / procedure / function performing similar on for example all tables.
 

Anderson Clayton

New Member
Dynamic code is slower than static code, throws run-time errors instead of compile-time errors and can easily leak memory if you are not cleaning up after yourself.

But, it does allow you to execute actions dynamically so you can have one class / procedure / function performing similar on for example all tables.
Thank Stefan, i get it, so in brief, does it worth keep on to write dynamic code?
 
Last edited:

Anderson Clayton

New Member
For what it is worth... IMHO most functionality is easier to write, easier to read, and easier to debug with static code. So unless I have a good reason to prefer a dynamic approach for something I am coding I default to static.
Thanks Tom, i keep following your tips cause it pretty usefull.
 

tamhas

ProgressTalk.com Sponsor
While implied by what Tom said, I think it is worth noting that dynamic code tends to be obscure while static code can be very clear in intent and purpose.
 

chrisds

New Member
i use dynamic codes when i don't have the luxury of actual changing the database table structure. eg, tables that have been used by many programs which i can't guarantee the versions :) other than that, static is good.
 
Top