Are code generators bad?

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

    Code generation is bad when it makes programming more difficult (IE, poorly generated code, or a maintenance nightmare), but they are good when they make programming more efficient.

    They probably don't always generate optimal code, but depending on your need, you might decide that developer manhours saved make up for a few minor issues.

    All that said, my biggest gripe with ORM code generators is that maintenance the generated code can be a PITA if the schema changes.

提交回复
热议问题