作为两种语言的程序员...... [英] As a programmer of both languages...

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

问题描述



关于哪个更好或者更好,C或C ++,似乎有一个空洞的争论,看起来这些讨论之一就是 - />
现在就在这个新闻组中。


我是一个以C ++开始的程序员,现在正在做什么

。在C中的嵌入式系统项目。在我看来,两种语言之间的关系和比较很简单。


C ++的目标是构建在C;采取C />
可以做的所有事情,然后添加一些功能,例如类,操作符

重载和异常。


俯瞰

两种语言的常见子集之间的微小差异(例如转换为void *,字符类型

literals),它是'非常准确地说C ++是C还有一些额外的

功能。


所以在最基本的,你可以说C ++比C更好

它可以完成C可以做的所有事情,并且它还有一些额外的

功能。这一切都很棒,但是这些额外的b / b
功能的代价是增加了编译器的复杂性。我现在正在为PIC 16F684微控制器编写一个程序(比邮票大小少了两美元),并且没有一个滚雪球的机会

我为此找到了一个C ++编译器。为什么?因为没有人打算写一个。我的意思是*有* *你* *看到* C ++

标准的大小? :-O不仅如此,而且在为嵌入式系统编程时,

程序的性质并不会产生对象的需求

面向对象节目。我正在编写的当前程序是一个

Connect4游戏,并且还没有一个实例我已经因为面向对象而渴望(b
$ b)即使我在编写PC应用程序时广泛使用类

)。


所以我自己的观点是,虽然C ++是编程

语言今天用于PC,游戏机等,C是

在嵌入式系统方面仍然是王者,而且看起来并不是什么? >
喜欢很快改变。对于我们这里不太熟练的人来说,

有用于PC的Java和用于微控制器的Basic。


-
$ b $bTomásóhéilidhe


There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.

I''m a programmer who started out in C++, and who''s currently doing
an embedded systems project in C. The relationship and comparison
between the two languages is very simple in my opinion.

The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.

Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it''s quite accurate to say that C++ is C with some more added
features.

So at the most basic, you can say that C++ is better than C in that
it can do everything C can does, and that it has a few more extra
features. That''s great and all, but the price to pay for these extra
features is the increased complexity of the compiler. I''m currently
writing a program for the PIC 16F684 microcontroller (which is less than
the size of a postage stamp), and there wouldn''t be a snowball''s chance
in hell of me finding a C++ compiler for it. Why? Because nobody''s
bothered writing one. I mean *have* *you* *seen* the size of the C++
Standard? :-O Not only that, but when programming for embedded systems,
the nature of the programs doesn''t tend to give rise to a desire for
object-orientated programming. The current program I''m writing is a
Connect4 game, and there hasn''t be one instance yet in which I''ve
yearned for object orientation (even though I use classes extensively
when writing PC applications).

So my own point of view is that while C++ is the programming
language to be used today for PC''s, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn''t seem
like changing any time soon. And for the less-than-proficient among us,
there''s Java for PC''s, and Basic for micrcontrollers.

--
Tomás ó héilidhe

推荐答案

Tomásóhéilidhe说:
Tomás ó héilidhe said:

>

关于哪个更好或者更好,C或C ++,似乎有一个空洞的争论,看起来这些讨论之一就在 -

现在就在这个新闻组中。
>
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.



这确实是一场空洞的辩论。有些问题在C语言中比在C ++中更适合

,反之亦然,而且有些程序员在C语言上比在C ++语言中更好,而在某些程序员方面则更好。一个人的语言选择部分取决于程序,部分取决于程序员




< snip>


-

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

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

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

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

It is indeed a vacuous debate. Some problems fit better in C than in C++
and vice versa, and some programmers are better at C than at C++ and vice
versa. One''s language choice depends partly on the program and partly on
the programmer.

<snip>

--
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


" Tom ???????????????????????? ??????????????????? ?????????????????????????????????????????????????? "写道:
"Tom?????????????????????????????????????????????? ?????????????????????????????????????????????????? " wrote:

关于哪个更好或者更好,或者更好,C或C ++,似乎有一个空洞的争论,它看起来像一个这些讨论现在正在这个新闻组中进行 -

There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.



不是真的,除了像你这样的一些白痴试图重启这样的b $ b愚蠢的辩论。走开。


[vapid language-war fodder snipped]

Not really, except for a few idiots like you who try to restart such
stupid "debate". Go away.

[vapid language-war fodder snipped]


Tomásóhéilidhe写道:
Tomás ó héilidhe wrote:

关于哪个更好或者更好,C或C ++似乎有一个空洞的争论,看起来这些讨论之一就在上面了 -

现在就在这个新闻组中。
There seems to be constant vacuous debate about which is better or
preferable, C or C++, and it looks like one of these discussions is on-
going right now in this newsgroup.



不,它从来就不是关于C或C ++的讨论,因为大多数人

这里会同意C是更好的选择


我们讨论的是我们是否应该在C中加入一些

修改,如运算符重载和try / catch进入核心C

语言。


我开发了一个C编译器,它以

的方式实现了这些增强功能符合C标准。这在某种程度上冒犯了很多人,这就是说C不需要。那些东西,即使它消失了,最好还是像现在一样离开它。

No, it has never been a discussion about C or C++, since most people
here will agree that C is the better choice

What we are discussing is whether we should incorporate into C some
modifications like operator overloading and try/catch into the core C
language.

I have developed a C compiler that implements those enhancements in a
way that is compatible with the C standard. This offends many people
here that say that C "doesn''t need" those things and even if it
disappears, it is better to leave it like it is now.


我是一个程序员谁开始在C ++中,以及谁正在用C进行嵌入式系统项目。两种语言之间的关系和比较

在我看来非常简单。 br />

C ++的目标是建立在C语言之上;采取C />
可以做的所有事情,然后添加一些功能,例如类,运算符

重载和异常。
I''m a programmer who started out in C++, and who''s currently doing
an embedded systems project in C. The relationship and comparison
between the two languages is very simple in my opinion.

The objective of C++ was to build upon C; to take everything that C
can do, and then add a few more features, such as classes, operator
overloading, and exceptions.



C和C ++之间的区别是C ++的面向对象。 C是

不是面向对象的。

The difference between C and C++ is the object orientation of C++. C is
not object oriented.


忽略

两种语言的公共子集之间的微小差异(例如转换自void *,字符的类型

literals),说C ++是C还有一些更多的

特性是非常准确的。 />
Overlooking the small differences between the common subset of the
two languages (e.g. converting from void*, the type of character
literals), it''s quite accurate to say that C++ is C with some more added
features.



太多添加的功能很简单。我所建议的并不是花费所有

而只是两个,以使C更容易使用。

Too many added features pecisely. What I am proposing is not taking all
of that but just two, to make C an easier language to use.


所以在最基本的,你可以说C ++比C更好

它可以完成C可以做的所有事情,并且它还有一些额外的

功能。这一切都很棒,但是这些额外的b / b
功能的代价是增加了编译器的复杂性。我现在正在为PIC 16F684微控制器编写一个程序(比邮票大小少了两美元),并且没有一个滚雪球的机会

我为此找到了一个C ++编译器。为什么?因为没有人打算写一个。我的意思是*有* *你* *看到* C ++

标准的大小? :-O不仅如此,而且在为嵌入式系统编程时,

程序的性质并不会产生对象的需求

面向对象节目。我正在编写的当前程序是一个

Connect4游戏,并且还没有一个实例我已经因为面向对象而渴望(b
$ b)即使我在编写PC应用程序时广泛使用类

)。
So at the most basic, you can say that C++ is better than C in that
it can do everything C can does, and that it has a few more extra
features. That''s great and all, but the price to pay for these extra
features is the increased complexity of the compiler. I''m currently
writing a program for the PIC 16F684 microcontroller (which is less than
the size of a postage stamp), and there wouldn''t be a snowball''s chance
in hell of me finding a C++ compiler for it. Why? Because nobody''s
bothered writing one. I mean *have* *you* *seen* the size of the C++
Standard? :-O Not only that, but when programming for embedded systems,
the nature of the programs doesn''t tend to give rise to a desire for
object-orientated programming. The current program I''m writing is a
Connect4 game, and there hasn''t be one instance yet in which I''ve
yearned for object orientation (even though I use classes extensively
when writing PC applications).



需要一种简单的语言,而不仅仅是PIC 16F684。需要一个简单的

语言,因为它更容易使用!


现在,它不会太简单,因为这样可以使用起来更难比

必要。

A simple language is needed, not ONLY for the PIC 16F684. A simple
language is needed because it is easier to use!

Now, it can''t be TOO simple, because that makes it HARDER to use than
necessary.


所以我自己的观点是,虽然C ++是编程

语言今天用于个人电脑,游戏机等等,在嵌入式系统方面,C仍然是王者,而且看起来并不是很好。

喜欢随时改变。对于我们这里不太熟练的人来说,

有用于PC的Java和用于微控制器的Basic。
So my own point of view is that while C++ is the programming
language to be used today for PC''s, game consoles and the like, C is
still the king when it comes to embedded systems, and that doesn''t seem
like changing any time soon. And for the less-than-proficient among us,
there''s Java for PC''s, and Basic for micrcontrollers.



No. C是通用编程语言。通过一些增强功能和

a更好的库,它可以成为一个很棒的编程语言来完成很多任务。

-

jacob navia

jacob at jacob point remcomp point fr

logiciels / informatique
http://www.cs.virginia.edu/~lcc-win32


这篇关于作为两种语言的程序员......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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