OOP [英] OOP

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

问题描述

嗨伙计们,


我倾向于喜欢C,当然我知道结构

可以在C中用来实现像这样的东西/>
面向对象的设计。而且我更喜欢C部分

因为我认为C ++已经成长为一个可以牺牲可读性的怪物。

但是我想知道,有没有人试图创建一个简单版本的C ++,如果你愿意的话,就是一个C +,它会给C增加几个关键特性和不允许的
事情

喜欢模板,多重继承等等?


谢谢。

解决方案

ca*********@yahoo.com 说:


嗨伙计们,


我倾向于选择C,当然我知道结构

可以是在C中用来实现类似于面向对象设计的
。而且我更喜欢C部分

因为我认为C ++已经成长为一个可以牺牲可读性的怪物。

但是我想知道,有没有人试图创建一个简单版本的C ++,如果你愿意的话,就是一个C +,它会给C增加几个关键特性和不允许的


喜欢模板,多重继承等?



是的。它永远不会很好。如果那就是你想要的,那么就自己使用C ++和

自律,不要使用你认为妨碍的功能./ b $ b可读性。 (这就是我在C中已经做过的事情。比如说,goto可以说是
并不意味着我需要使用它。)


-

Richard Heathfield< http://www.cpax.org.uk>

电子邮件:-http:// www。 + rjh @

谷歌用户:< http://www.cpax.org.uk/prg/writings/googly.php>

Usenet是一个奇怪的放置" - dmr 1999年7月29日


6月30日12:35 * pm,Richard Heathfield< r ... @ see.sig.invalidwrote:
< blockquote class =post_quotes>
是的。它永远不会很好。如果那就是你想要的,那么就自己使用C ++和

自律,不要使用你认为妨碍的功能./ b $ b可读性。 (这就是我在C中已经做过的事情。比如说,goto可以使用
并不意味着我需要使用它。)



你有一个观点。而且我知道我所做的任何事情或者说没有什么可以阻止其他人使用C ++的有问题的功能

甚至是糟糕的好功能。


但是类比可能是C就像一辆汽车,

C ++就像一辆摩托车。使用摩托车和C ++更容易发生事故



虽然我是所有车辆的小心驾驶员,但是b $ b和一个仔细的编码器,如果我向雇主说我是C ++程序员,那么他们会把他绑在别人的C ++代码上,那么机会就更高了。

br />
比我说的那样难以理解

a C程序员。


> >>>" CH" == campyhapper< ca ********* @ yahoo.comwrites:


chBut我想知道,有没有人试图创造一种精简版

chversion of C ++,如果你愿意的话就是一个C +,它只会增加几个关键的b / b
chfeatures和不允许像模板,多个

chinheritance之类的东西等等。 ?


C ++的理念是不让你支付语言功能,而不是b
不要使用。使用C ++,但不要使用你不喜欢的功能。


Charlton

-

Charlton Wilbur
cw*****@chromatico.net


Hi folks,

I tend to prefer C, and of course I know that structs
can be used in C to achieve something like
an object-oriented design. And I prefer C in part
because C++ has, I think, grown into a bit of a
monster wherein readability is sacrificed.
But I wonder, has anyone ever tried to create a
sort of lite version of C++, a C+ if you will, that adds
to C just a few key features and disallows things
like templates, multiple inheritance and the like?

Thanks.

解决方案

ca*********@yahoo.com said:

Hi folks,

I tend to prefer C, and of course I know that structs
can be used in C to achieve something like
an object-oriented design. And I prefer C in part
because C++ has, I think, grown into a bit of a
monster wherein readability is sacrificed.
But I wonder, has anyone ever tried to create a
sort of lite version of C++, a C+ if you will, that adds
to C just a few key features and disallows things
like templates, multiple inheritance and the like?

Yes. It never works very well. If that''s what you want, just use C++ and
discipline yourself not to use the features that you think hamper
readability. (That is what I already do in C. The fact that goto, say, is
available does not mean that I am required to use it.)

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999


On Jun 30, 12:35*pm, Richard Heathfield <r...@see.sig.invalidwrote:

Yes. It never works very well. If that''s what you want, just use C++ and
discipline yourself not to use the features that you think hamper
readability. (That is what I already do in C. The fact that goto, say, is
available does not mean that I am required to use it.)

You have a point. And I know that nothing I do or say
will stop others from using C++''s problematic features
or even its good features in bad ways.

But an analogy might be that C is like a car,
C++ is like a motorcycle. Accidents happen
more readily with motorcycles and with C++.
And although I''m a careful driver of all vehicles,
and a careful coder, chances are higher that,
if I say to an employer "I''m a C++ programmer"
they will stick me with someone else''s C++ code
that is incomprehensible than if I say I''m
a C programmer.


>>>>"ch" == campyhapper <ca*********@yahoo.comwrites:

chBut I wonder, has anyone ever tried to create a sort of lite
chversion of C++, a C+ if you will, that adds to C just a few key
chfeatures and disallows things like templates, multiple
chinheritance and the like?

C++ has a philosophy of not making you pay for language features you
don''t use. Use C++, but don''t use the features you don''t like.

Charlton
--
Charlton Wilbur
cw*****@chromatico.net


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

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