C# 语言名称的由来
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1991345/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Origin of the C# language name
提问by Prasoon Saurav
I am a C and C++ programmer and am now trying to learn C#. I have bought the book Professional C#by Wrox publications.
我是一名 C 和 C++ 程序员,现在正在尝试学习 C#。我购买了Wrox 出版的Professional C#一书。
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'.
在从 C 迁移到 C++ 时,我怀疑为什么++
要添加到 C。后来我意识到,因为++
是一个增量运算符,它被添加到 C 只是为了提供一个“面向对象的扩展”。
In C#, what is the significance of #
?
在 C# 中, 的意义是#
什么?
采纳答案by Gregory Pakosz
The name "C sharp" was inspired from musical notation where a sharp indicates that the written note should be made a half-step higher in pitch.[6] This is similar to the language name of C++, where "++" indicates that a variable should be incremented by 1. The sharp symbol also resembles a ligature of four "+" symbols (in a two-by-two grid), further implying that the language is an increment of C++.
Due to technical limitations of display (standard fonts, browsers, etc.) and the fact that the sharp symbol (?, U+266F, MUSIC SHARP SIGN) is not present on the standard keyboard, the number sign (#, U+0023, NUMBER SIGN) was chosen to represent the sharp symbol in the written name of the programming language.[7] This convention is reflected in the ECMA-334 C# Language Specification.3However, when it is practical to do so (for example, in advertising or in box art[8]), Microsoft uses the intended musical symbol.
“C 升”这个名字的灵感来自于乐谱,其中一个升表示所写的音符应该在音高上提高半步。 [6] 这类似于 C++ 的语言名称,其中“++”表示变量应递增 1。尖符号也类似于四个“+”符号的连字(在一个 2×2 的网格中),进一步暗示该语言是 C++ 的增量。
由于显示的技术限制(标准字体、浏览器等)以及标准键盘上不存在尖符号(?、U+266F、MUSIC SHARP SIGN)的事实,数字符号(#、U+0023 , NUMBER SIGN) 被选择来表示编程语言书面名称中的尖符号。 [7] 此约定反映在 ECMA-334 C# 语言规范中。3但是,如果可行(例如,在广告或盒子艺术中[8]),Microsoft 会使用预期的音乐符号。
Also, in this interview, Anders Hejlseberg says:
此外,在这次采访中,Anders Hejlseberg 说:
"We wanted to have a reference to the language's C heritage in the name and finally settled on C#. Some other candidates I recall were e-C, Safe C, C-square, C-cube, C-prime, C-star, and Cesium… Looking and those now I'm pretty happy with our choice."
“我们想在名称中引用该语言的 C 遗产,最终选择了 C#。我记得的其他一些候选对象是 eC、Safe C、C-square、C-cube、C-prime、C-star 和 Cesium ......现在我对我们的选择很满意。”
Finally, Naomi Hamilton asked Anders Hejlseberg the question directly:
最后,Naomi Hamilton 直接问了 Anders Hejlseberg 这个问题:
[NH] Why was the language originally named Cool, and what promoted the change to C#?
[AH] The code name was Cool, which stood for ‘C like Object Oriented Language'. We kind of liked that name: all of our files were called .cool and that was kind of cool! We looked seriously at keeping the name for the final product but it was just not feasible from a trademark perspective, as there were way too many cool things out there.
So the naming committee had to get to work and we sort of liked the notion of having an inherent reference to C in there, and a little word play on C++, as you can sort of view the sharp sign as four pluses, so it's C++++. And the musical aspect was interesting too. So C# it was, and I've actually been really happy with that name. It's served us well.
[NH] 为什么该语言最初命名为 Cool,是什么推动了向 C# 的转变?
[AH] 代号是 Cool,代表“C like Object Oriented Language”。我们有点喜欢这个名字:我们所有的文件都被称为 .cool,这很酷!我们认真考虑保留最终产品的名称,但从商标的角度来看这是不可行的,因为那里有太多很酷的东西。
所以命名委员会必须开始工作,我们有点喜欢在那里有一个对 C 的内在引用的概念,以及在 C++ 上的一些文字游戏,因为你可以将尖号视为四个加号,所以它是 C++++ . 音乐方面也很有趣。所以它是 C#,而且我实际上对这个名字非常满意。它为我们服务很好。
回答by Peter
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...
好吧,虽然 c++ 是带有“面向对象扩展”的 c,但另一方面,c# 不仅仅基于 c 的语法,而且完全面向对象并编译为 msil,而本机 c++ 编译为本机二进制代码...
回答by driis
Have a look at this explanation: http://www.jameskovacs.com/blog/CNETHistoryLesson.aspx
看看这个解释:http: //www.jameskovacs.com/blog/CNETHistoryLesson.aspx
C# name was musically inspired. It is a C-style language that is a step above C/C++, where sharp (#) means a semi-tone above the note.
C# 名称受音乐启发。它是一种 C 风格的语言,比 C/C++ 高一步,其中尖 (#) 表示音符上方的半音。
回答by ljs
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++ 是 C 递增的,# 表示 C++ 递增,或 C++++;一种具有 C 语法的语言,提供更高级别的功能。
Check out the wikipedia articleon this.
查看维基百科上的文章。
回答by Guffa
It's just a name. The # character is taken from the musical notation meaning C# (C sharp) is half a note above C.
这只是一个名字。# 字符取自乐谱,意思是 C#(升 C)比 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++,但也基于 Java 和 Pascal (Delphi)。与 Java 一样,C# 是面向对象的语言,而 C++ 和 Pascal 是具有面向对象功能的过程语言。
回答by Jay Bazuzi
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”的结果。现在,搜索引擎更智能。)
回答by Hans Passant
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.
鉴于这是一个程序员的网站,也许列出“真实姓名”很有趣,即微软程序员在从事项目时使用的名字。这些名称往往像考古记录一样出现在 CLR(转子)、SDK 头文件和参考源的源代码中。
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.
C# 一开始是 COOL(类似 C 的面向对象语言)。Rotor 生成文件显示,早期的 C# 代码可能已写入文件扩展名为 .cool 的文件中。但是,也有几个地方将其命名为 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.
CLR 有几个名字。它最初是作为 Windows 2000 的 COM+ 工作组内部的一个项目,在 CLR 源代码中有许多对“ComPlus”的引用。托管异常的异常代码是 0xe0434f4e, 0xe0 + "COM"+1。在 WinError.h 文件中,CLR 错误代码使用“URT”、“Universal Run Time”。缩写“Cor”出现在托管界面的许多地方,即“COM Object Runtime”。CLR 源代码非常普遍地使用 EE 首字母缩写词,与 COR 不同,是执行引擎的缩写,是 CLR 代码库中的一部分更改,以使其执行托管代码。
Internal project names I've seen:
我见过的内部项目名称:
- Rainier: Visual Studio 2002
- Everett: Visual Studio 2003
- Whidbey: Visual Studio 2005
- Orcas: Visual Studio 2008
- Hawaii: Visual Studio 2010 (very early)
- Rotor: Shared Source version of the CLR
- Avalon: WPF
- Indigo: WCF
- Yukon: SQL Server 2005
- Katmai: SQL Server 2008
- Strike: a custom debugger extension used to debug the first version of the CLR, evolved into SOS (Son of Strike).
- 雷尼尔:Visual Studio 2002
- 埃弗雷特:Visual Studio 2003
- 惠德比:Visual Studio 2005
- 逆戟鲸:Visual Studio 2008
- 夏威夷:Visual Studio 2010(很早)
- Rotor:CLR 的共享源版本
- 阿瓦隆:WPF
- 靛蓝:WCF
- 育空地区:SQL Server 2005
- 卡特迈:SQL Server 2008
- Strike:自定义调试器扩展,用于调试 CLR 的第一个版本,演变为 SOS(Son of Strike)。
回答by Hans Passant
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.
1991 年,Al Stevens 在 Dr. Dobbs Journal (DDJ) 中介绍了 D-Flat;一个基于 DOS 的、事件驱动的框架,用于构建用户界面(参见http://www.ddj.com/184408553)。当时,D-Flat 是用 C 编写的,因为 Al Stevens 为 DDJ 编写了 C 编程专栏。C++ 这个名字已经被取了,他也考虑过 C-Sharp,但他确信有人已经想到了(参见http://www.ddj.com/184410858)。我的观点是,Al Stevens 一直在考虑 C-Sharp 这个名字,因为 D-Flat 不是心血来潮,而且他有很多语言经验。
回答by jlru
C# is a musically inspired named and there is also Polyphonic C#
C# 是一个受音乐启发的名字,还有和弦 C#
回答by Petter berrie
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++ 是 C 递增的,# 表示 C++ 递增,或 C++++;一种具有 C 语法的语言,提供更高级别的功能。