Are there macro facility for Java or C#?

前端 未结 4 466
情话喂你
情话喂你 2021-01-13 13:33

Macros are useful.

Therefore, I occasionally bemoan the absence of macros in Java and C#. Macros allow me to force in-line but allow me the code-manageability of non

4条回答
  •  礼貌的吻别
    2021-01-13 14:22

    I would recommend trusting the JIT compiler to make the decision for you when it comes to inlining.

    However, if you are just after macros for other purposes, in C#/.NET, there are other options. Much of what can be done with macros for utility purposes can be done via T4 (Text Template Transformation Toolkit). This is the basis for many ORM packages, for example.

提交回复
热议问题