Code analysis is something that looks different from what is being treated. There is static analysis (a compiler-like tool does this in source code) and dynamic analysis that tracks actual code execution.
Static code, in a given context, is a term that has little use. It indicates that the code was generated manually or automatically (in scaffolding, for example) at development time.
Dynamic code is one that is generated at runtime. This requires that the language and environment where it runs allow this to occur. It has several techniques to accomplish this. Some safer, others dangerous. Eventually we can say that the simple injection of code can be a dynamism. But I don’t know if it can be applied here if the code was previously generated.
Maybe you’re talking about self modifying code.
In other contexts, it can mean something else.
It depends on the context. In the current form, I find it difficult to give an adequate answer.
– Maniero
@bigown These terms do not have a standard "meaning", or global, so to speak?
– Randrade
I don’t know. And it seems that each of the two are being used "in this conversation" for things so different that already shows this. It seems they are not being used one as opposed to the other. The obvious Google search shows that this has to do with code analysis in both cases, but this is a Google glitch. The word "analysis" makes all the difference in context.
– Maniero
@bigown So these definitions are not wrong? Of course, depending on the context.
– Randrade
Depending on the context anything is right :) For me static code is the one that is all generated at development time and dynamic code is the one that is generated at runtime. By generation, you can understand how to adapt too.
– Maniero
Thanks @bigown. Already helped me. I’ll let the question press to see if anyone else has any opinions. But if you want, you can vote to close, I really agree with you that it’s a little wide, but there’s no way to express myself better about it, unfortunately.
– Randrade
I consider dynamic code something changeable without code rewriting. Ex.: A code that supports parameterization is dynamic. If it employs constants, it is static. But it goes from case to case.
– Andre Mesquita