Are code generators bad?

后端 未结 26 1680
耶瑟儿~
耶瑟儿~ 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: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.

提交回复
热议问题