编程术语

发布于 2024-08-22 05:14:01 字数 132 浏览 2 评论 0原文

很久以前,我的大学教授定义了一个术语,表示变量定义与其用法之间的源代码行数。

该课程基本上认为,这两个值越接近,从长远来看就越容易维持。

我的 Google-Fu 一直很弱。

描述这种关系的术语是什么?

A long time ago, my college professor defined a term which meant the number of source lines between a variable definition and its usage.

The lesson basically argued that the closer the two values are, the easier it will be to maintain over the long run.

My Google-Fu has been weak.

What is the term that describes this relationship?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

归属感 2024-08-29 05:14:01

在此页面上找到 http://www.ppig.org/papers/11th-douce。 pdf,在文档的第 6 页,它讨论了对象关系度量,或ORM,并给出了定义和计算方法。我想这就是您可能正在寻找的。


是代码空间复杂度吗?

Found on this page http://www.ppig.org/papers/11th-douce.pdf , on page 6 of the document it talks about Object Relation Measure, or ORM, and gives the definition and way to calculate it. I think this is what you might be looking for.


is it Code spatial complexity ?

空袭的梦i 2024-08-29 05:14:01

我在阅读 Code Complete 2 时第一次遇到这个概念。

我认为您正在寻找的术语在那本书中是“跨度”,它明确是对变量的引用之间的行数。在我的解释中,在连续行上声明和使用的变量的跨度为 0。

该概念也可重用于对该变量的其他引用,以提供更广泛的可维护性衡量标准 - 声明和首次使用之间的跨度可能为 0,但是如果 100 行后再次使用该变量,那仍然很糟糕。

I came across this concept for the first time whilst reading Code Complete 2.

I think the term you're looking for is 'span' in that book, which is explicitly the number of lines between references to a variable. In my interpretation, a variable declared and used on consecutive lines would have a span of 0.

The concept is reusable for other references to the variable too to give a wider measure of maintainability - the span between declaration and first use may be 0, but if the variable is then used again 100 lines later that's still pretty nasty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文