您是否创建自己的代码生成器? [英] Do you create your own code generators?

查看:47
本文介绍了您是否创建自己的代码生成器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实用程序员提倡使用代码发电机。
您是否在项目上创建代码生成器?如果是,您将它们用作什么?

The Pragmatic Programmer advocates the use of code generators. Do you create code generators on your projects? If yes, what do you use them for?

推荐答案

代码生成器(如果广泛使用而没有正确的论点)会使代码难以理解并降低可维护性(顺便说一下,与动态SQL相同)。我个人将它与一些ORM工具一起使用,因为它们在这里的用法通常很明显,有时用于诸如搜索器解析器算法和语法分析器之类的东西,这些东西最近都不是手动维护的。干杯。

Code generators if used widely without correct argumentation make code less understandable and decrease maintainability (the same with dynamic SQL by the way). Personally I'm using it with some of ORM tools, because their usage here mostly obvious and sometimes for things like searcher-parser algorithms and grammatic analyzers which are not designed to be maintained "by hands" lately. Cheers.

这篇关于您是否创建自己的代码生成器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆