C ++相当于spaghetti代码 [英] C++ equivalent to spaghetti code

查看:67
本文介绍了C ++相当于spaghetti代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想提请你注意一个概念

和一个我认为早就应该的术语。 />

但首先:在编程过去的糟糕时期,即使子程序可用之前,也可以获得


人们习惯写spaghetti代码,

是一个难以理解的,无法维护的混乱

" goto"声明。


随着更多

语言(例如Pascal和C)的可用性,以及

专注于编程课程重要性

模块化和抽象数据类型,

有人可能认为

普通难以理解的代码的日子结束了,
或者至少是最糟糕的情况

的平均代码得到了改善。


对于C ++,情况并非如此。

C ++,具有多重继承,

模板和极其臃肿的类库

,如STL和Boost,允许和

似乎甚至需要难以辨认的编码实践

其中5-deep派生类不是不可能
,导致C ++等价物

的意大利面条代码。


但如何描述呢?通常人们只需称之为糟糕的编码习惯。但这个

太笼统了。这就像召唤交通事故

糟糕的驾驶习惯。然后,什么是意外的

术语。在C ++中?为了形容这个纠结不可理解的膨胀,

我将提出一个新术语:

C ++牌匾。


它类似于斑块积聚

阿尔茨海默氏症只会损害记忆力,

让程序员对此感到困惑/>
位于何处和当天的位置。

此外,当C ++牌匾累积时,

它会降低程序员的能力

在他/她的日常工作生活中运作,因为他生产的任何东西都会更多

可能会崩溃,例如KDE。


通过不污染来对抗代码污染。


C ++牌匾:治愈在你体内。


感谢您的关注。

Hello all,

I would like to bring to your attention a concept
and a term for it that I think is long overdue.

But first: In the bad old days of programming,
before subroutines were even available,
people used to write "spaghetti code", which
was an unreadable, unmaintainable mess of
"goto" statements.

With the increased availability of more
languages such as Pascal and C, and the
focus in programming courses on the importance
of modularity and abstract data types,
one might have thought that the days of
commonplace incomprehensible code were over,
or at least that the worst case scenario
in average code was improved.

In the case of C++, this is not so.
C++, with its multiple inheritance,
templates, and vastly bloated class libraries
such as STL and Boost, which permit and
seem even to require illegible coding practices
in which 5-deep derived classes are not
unlikely, has led to the C++ equivalent
of spaghetti code.

But how to describe it? Commonly people
simply call it "bad coding practices" but this
is too general. It''s like calling a traffic accident
"bad driving practices". What then is the
term for an "accident" in C++? To describe this
build-up of tangled incomprehensible bloat,
I shall propose a new term:
C++ plaque.

It is similar to the plaque build-up in
Alzheimer''s insofar as it impairs memory,
makes the programmer confused about
what is located where and what day it is.
In addition, when C++ plaque accumulates,
it decreases the programmer''s ability
to function in his/her daily work life, ergo
anything (s)he produces will be much more
likely to crash, e.g. KDE.

Fight code pollution by not polluting.

C++ plaque: The cure is within you.

Thank you for your attention.

推荐答案

Campy Happer< ca ********* @ yahoo.comwrites:
Campy Happer <ca*********@yahoo.comwrites:

大家好,


我想提请你注意一个概念

和我认为这个术语早就应该了。
Hello all,

I would like to bring to your attention a concept
and a term for it that I think is long overdue.



[snip]


我想提请你注意C和C ++的事实

两种不同的语言。这可能适用于comp.lang.c ++;

它在comp.lang.c或gnu.misc.discuss中是不合适的。请

限制comp.lang.c ++的任何后续操作。 (我怀疑这会有什么好处,但是值得一试。)


-

Keith Thompson(The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>

诺基亚

我们必须做点什么。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长

[snip]

I would like to bring to your attention the fact that C and C++ are
two different languages. This may be appropriate in comp.lang.c++;
it''s not appropriate in comp.lang.c or gnu.misc.discuss. Please
restrict any followups to comp.lang.c++. (I doubt that this will do
any good, but it''s worth a try.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


Campy Happer写道:
Campy Happer wrote:

对于C ++,情况并非如此。

C ++,具有多重继承,

模板和夸张的类库

如STL和Boost,允许和

似乎甚至需要难以辨认的编码实践

其中5-深度派生类不太可能不是b $ b,导致了C ++相当于意大利面条代码的b $ b。
In the case of C++, this is not so.
C++, with its multiple inheritance,
templates, and vastly bloated class libraries
such as STL and Boost, which permit and
seem even to require illegible coding practices
in which 5-deep derived classes are not
unlikely, has led to the C++ equivalent
of spaghetti code.



去其他地方转播,Linus Torvalds。

Go troll somewhere else, Linus Torvalds.


On Tue,2008年7月15日08:03:29 -0700,Campy Happer写道:


< some废话>


我们可以用phuleeeze来喂养巨魔。


< plonk>


-

Lionel B
On Tue, 15 Jul 2008 08:03:29 -0700, Campy Happer wrote:

<some nonsense>

Can we phuleeeze not feed the troll.

<plonk>

--
Lionel B


这篇关于C ++相当于spaghetti代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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