What does "Emit" mean in the context of .Net Reflection?

What does Emit mean in .Net, is it the same as the "Generate Code" value?

For example, if I were developing a class with a function that returned some code that it produced, what name would be semantically more correct MyClass.EmitCode() or MyClass.GenerateCode() ?

What do I need to understand in .Net?

+4
source share
1 answer

At the level of the English language, the word “emit” essentially means “give out”, “produce” - therefore, in this sense, it is reasonable to use “generate” as a synonym. However, there may be some confusion between this general use of “emission” and also a very specific use, i.e. System.Reflection.Emit - the latter refers to IL generation, not code generation.

In your case, since you include the word "code", i.e. EmitCode() , I'm not sure if this ambiguity exists. So I'm not sure if there is a strong argument for or against the use of the word "emit" here. Honestly, while you are documenting what this method does, I'm not sure if this is very important, p

+5
source

Source: https://habr.com/ru/post/1501806/


All Articles