C#语言名称的由来
我是一名 C 和 C++ 程序员,现在正在尝试学习 C#。我购买了 Wrox 出版社的专业 C# 这本书。
在从 C 迁移到 C++ 时,我有一个疑问为什么 ++
被添加到 C 中。后来我意识到,由于 ++
是一个增量运算符,所以它被添加到 C 中只是为了提供“面向对象的扩展”。
在C#中,#
的意义是什么?
I am a C and C++ programmer and am now trying to learn C#. I have bought the book Professional C# by Wrox publications.
While migrating from C to C++ I had a doubt why ++
was added to C. Later on I realized that since ++
is an increment operator and it was added to C just to provide an 'Object Oriented Extension'.
In C#, what is the significance of #
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
来自维基百科。
另外,在 这次采访,Anders Hejlseberg 说:
最后,
From Wikipedia.
Also, in this interview, Anders Hejlseberg says:
Finally, Naomi Hamilton asked Anders Hejlseberg the question directly:
1991年,Al Stevens在Dr. Dobbs Journal (DDJ)中介绍了D-Flat;用于构建用户界面的基于 DOS 的事件驱动框架(请参阅 http://www.ddj.com/184408553< /a>)。当时,D-Flat 是用 C 编写的,因为 Al Stevens 为 DDJ 撰写了 C 编程专栏。 C++ 这个名字已经被使用,他也考虑过 C-Sharp,但确信有人已经想到了它(参见 http ://www.ddj.com/184410858)。我的观点是,Al Stevens 对 C-Sharp 这个名字已经考虑了很长时间,因为 D-Flat 并不是心血来潮,而且他有如此丰富的语言经验。
In 1991, Al Stevens introduced D-Flat in Dr. Dobbs Journal (DDJ); a DOS-based, event-driven framework for building user interfaces (see http://www.ddj.com/184408553). At the time, D-Flat was written in C, because Al Stevens wrote the C Programming column for DDJ. The name C++ was already taken and he had considered C-Sharp, but was convinced that someone had already thought of it (see http://www.ddj.com/184410858). My opinion is that Al Stevens had been thinking about the name C-Sharp for a long time, because D-Flat was not a whim and he has so much language experience.
鉴于这是一个程序员的网站,也许列出“真实姓名”(Microsoft 程序员在从事项目时使用的名称)会很有趣。这些名称往往会像考古记录一样出现在 CLR (Rotor) 的源代码、SDK 头文件和参考源中。
C# 最初是 COOL(类 C 面向对象语言)。 Rotor makefile 显示早期的 C# 代码可能是在文件扩展名为 .cool 的文件中编写的。不过,也有几个地方将其命名为COOLC。
CLR 有多个名称。它最初是作为 Windows 2000 的 COM+ 工作组内部的一个项目,在 CLR 源代码中有许多对“ComPlus”的引用。托管异常的异常代码为 0xe0434f4e、0xe0 +“COM”+1。在 WinError.h 文件中,CLR 错误代码使用“URT”、“通用运行时”。缩写“Cor”出现在托管接口“COM Object Runtime”的许多地方。 CLR 源代码通常使用 EE 缩写,与 COR 不同,COR 是执行引擎的缩写,也是 CLR 代码库中为了执行托管代码而进行的部分更改。
我见过的内部项目名称:
Given that this is a programmer's web site, perhaps it is interesting to list the "real names", the names that the Microsoft programmers used when they worked on the projects. These names tend to show up, like archeological records, in the source code for the CLR (Rotor), SDK header files and the Reference Source.
C# started out as COOL (C-like Object Oriented Language). The Rotor makefiles show that early C# code might have been written in files with the .cool filename extension. However, there are also several places where it is named COOLC.
The CLR had several names. It started out as a project inside the group that worked on Windows 2000's COM+, there are many references to "ComPlus" in the CLR source code. The exception code for a managed exception is 0xe0434f4e, 0xe0 + "COM"+1. In the WinError.h file, CLR error codes use "URT", "Universal Run Time". The contraction "Cor" appears in many places in the hosting interfaces, "COM Object Runtime". CLR source code very commonly uses the EE acronym, distinct from COR, short for Execution Engine and part of the changes in the CLR code base to get it to execute managed code.
Internal project names I've seen:
看看这个解释: http://www.jameskovacs.com/blog/CNETHistoryLesson.aspx< /a>
Have a look at this explanation: http://www.jameskovacs.com/blog/CNETHistoryLesson.aspx
“#”实际上是一个音乐升号符号——++ 表示 C++ 是 C 增量,# 表示 C++ 增量,或 C++++;一种具有 C 语法的语言,提供更高级别的功能。
请查看维基百科文章。
The '#' is actually meant to be a musical sharp symbol - as ++ indicates C++ is C incremented, # indicates C++ incremented, or C++++; a language with C-syntax, offering higher-level functionality.
Check out the wikipedia article on this.
“#”实际上是一个音乐升号符号——++ 表示 C++ 是 C 增量,# 表示 C++ 增量,或 C++++;一种具有 C 语法的语言,提供更高级别的功能。
The '#' is actually meant to be a musical sharp symbol - as ++ indicates C++ is C incremented, # indicates C++ incremented, or C++++; a language with C-syntax, offering higher-level functionality.
除了其他地方提到的音乐参考之外,请观察“♯”和“#”看起来像是两个重叠的“+”符号。
最终,尽管这是一个营销决策,而不是技术决策。
(顺便说一句:当时,我们认为这是一个糟糕的选择,因为搜索引擎会忽略“特殊”字符,并且您会得到“C”的结果。现在,搜索引擎更加聪明。)
In addition to the musical references noted elsewhere, observe that '♯' and '#' look like two '+' symbols overlapped.
In the end, though it was a marketing decision, not a technical one.
(As an aside: at the time, we thought it was a poor choice because search engines would ignore "special" characters, and you'd get results for 'C'. Now, search engines are smarter.)
这只是一个名字。 # 字符取自乐谱,表示 C#(升 C)比 C 高半个音符。C
# 部分基于 C/C++,但也基于 Java 和 Pascal (Delphi)。与 Java 一样,C# 是一种面向对象的语言,而 C++ 和 Pascal 是具有面向对象附加功能的过程语言。
It's just a name. The # character is taken from the musical notation meaning C# (C sharp) is half a note above C.
C# is partly based on C/C++, but also on Java and Pascal (Delphi). Like Java, C# is an object oriented language, while C++ and Pascal are procedural languages with added capability for object orientation.
C# 是一个受音乐启发的命名,还有 复音 C#
C# is a musically inspired named and there is also Polyphonic C#
好吧,虽然 c++ 是具有“面向对象扩展”的 c,但另一方面,c# 不仅仅基于 c 的语法,而且完全是面向对象的,并且编译为 msil,而本机 c++ 编译为本机二进制代码...
well while c++ is c with "Object Oriented Extension", c# on the other hand is not based on c only the syntax and is totaly object oriented and compiles to msil while native c++ compiles to native binary code...