元编程多少是太多? [英] Metaprogramming how much is too much?

查看:91
本文介绍了元编程多少是太多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着我越来越熟悉元编程技术,我也发现越来越多的元编程应用程序.我现在正在一个小项目中,我正在动态创建类和这些类的实例,我想知道我是否对元编程进行了过多研究?是否有太多的元编程这样的事情?如果是这样,一条线会划在哪里?

As I have become more and more comfortable using metaprogramming techniques I have found more and more applications for metaprogramming as well. I'm working now on a little project in which I am creating classes and instances of these classes on the fly and I'm wondering if I have taken metaprogramming too far? Is there such a thing as too much metaprogramming? If so, where does one draw the line?

推荐答案

当变得太难了

  • 测试
  • 调试
  • 了解
  • 维护

那么可能太多了. 元编程应该简化您的日常开发.如果最终您花费越来越多的时间来维护复杂的代码库,则可能需要简化它.

then it's probably too much. Metaprogramming is supposed to simplify your daily development. If you end up spending more and more time maintaning complicated code base, you probably need to simplify it.

这篇关于元编程多少是太多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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