Are code generators bad?

后端 未结 26 1668
耶瑟儿~
耶瑟儿~ 2021-02-07 07:44

I use MyGeneration along with nHibernate to create the basic POCO objects and XML mapping files. I have heard some people say they think code generators are not a good idea. Wha

相关标签:
26条回答
  • 2021-02-07 08:42

    The first C++ compilers were code generators that spit out C code (CFront).

    I'm not sure if this is an argument for or against code generators.

    0 讨论(0)
  • 2021-02-07 08:44

    Compilers are code generators, so they are not inherently bad unless you only like to program in raw machine code.

    I believe however that code generators should always completely encapsulate the generated code. I.e. you should never have to modify the generated code by hand, any change should be done by modifying the input to the generator and regenerate the code.

    0 讨论(0)
提交回复
热议问题