C#语言名称的由来

发布于 2024-08-17 02:40:18 字数 304 浏览 5 评论 0原文

我是一名 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

傲世九天 2024-08-24 02:40:18

“C 升号”这个名字的灵感来自于乐谱,其中升号表示书面音符的音调应该高半步。[6]这类似于 C++ 的语言名称,其中“++”表示变量应递增 1。尖号符号也类似于四个“+”符号的连字(在两乘二的网格中),进一步暗示该语言是 C++ 的增量。

由于显示的技术限制(标准字体、浏览器等)以及升号符号(♯、U+266F、音乐升号)的事实由于标准键盘上不存在,因此选择数字符号(#、U+0023、数字符号)来表示编程语言的书面名称中的锐号。 [7]此约定反映在 ECMA-334 C# 语言规范中。3 但是,当可行时(例如,在广告或包装盒艺术中[8]),Microsoft 会使用预期的音乐符号。< /p>

来自维基百科

另外,在 这次采访,Anders Hejlseberg 说:

“我们希望在名称中提及该语言的 C 传统,最终选定了 C#。我记得的其他一些候选语言包括 eC、Safe C、C-square、C-cube、C-prime、C-star 、铯……看看这些,现在我对我们的选择非常满意。”

最后,

[NH] 为什么该语言最初被命名为 Cool,是什么推动了向 C# 的转变?

[AH] 代号是 Cool,代表“C like Object Oriented Language”。我们有点喜欢这个名字:我们所有的文件都被称为.cool,这有点酷!我们认真考虑过保留最终产品的名称,但从商标的角度来看这是不可行的,因为那里有太多很酷的东西。

因此,命名委员会必须开始工作,我们有点喜欢其中对 C 的固有引用的概念,以及对 C++ 的一些文字游戏,因为您可以将锐号视为四个加号,所以它是C++++。音乐方面也很有趣。所以就是 C#,而且我实际上对这个名字非常满意。它对我们很有帮助。

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.3 However, when it is practical to do so (for example, in advertising or in box art[8]), Microsoft uses the intended musical symbol.

From Wikipedia.

Also, in this interview, Anders Hejlseberg says:

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

Finally, Naomi Hamilton asked Anders Hejlseberg the question directly:

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

树深时见影 2024-08-24 02:40:18

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.

分开我的手 2024-08-24 02:40:18

鉴于这是一个程序员的网站,也许列出“真实姓名”(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 代码库中为了执行托管代码而进行的部分更改。

我见过的内部项目名称:

  • Rainier:Visual Studio 2002
  • Everett:Visual Studio 2003
  • Whidbey:Visual Studio 2005
  • Orcas:Visual Studio 2008
  • Hawaii:Visual Studio 2010(非常早)
  • Rotor:CLR
  • Avalon 的共享源版本:WPF
  • Indigo: WCF
  • Yukon:SQL Server 2005
  • Katmai:SQL Server 2008
  • Strike:用于调试 CLR 第一个版本的自定义调试器扩展,后来演变为 SOS(Son of Strike)。

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:

  • 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).
我不会写诗 2024-08-24 02:40:18

看看这个解释: http://www.jameskovacs.com/blog/CNETHistoryLesson.aspx< /a>

C# 的名字受到音乐的启发。这是
一种 C 风格的语言,是一个步骤
高于 C/C++,其中尖号 (#) 表示
音符上方的半音。

Have a look at this explanation: 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.

罗罗贝儿 2024-08-24 02:40:18

“#”实际上是一个音乐升号符号——++ 表示 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.

儭儭莪哋寶赑 2024-08-24 02:40:18

“#”实际上是一个音乐升号符号——++ 表示 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.

烟沫凡尘 2024-08-24 02:40:18

除了其他地方提到的音乐参考之外,请观察“♯”和“#”看起来像是两个重叠的“+”符号。

最终,尽管这是一个营销决策,而不是技术决策。

(顺便说一句:当时,我们认为这是一个糟糕的选择,因为搜索引擎会忽略“特殊”字符,并且您会得到“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.)

空名 2024-08-24 02:40:18

这只是一个名字。 # 字符取自乐谱,表示 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.

水中月 2024-08-24 02:40:18

C# 是一个受音乐启发的命名,还有 复音 C#

C# is a musically inspired named and there is also Polyphonic C#

随心而道 2024-08-24 02:40:18

好吧,虽然 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文