既然C++读作“C加加”,那为什么C#不能读作“C井”呢?

其实真正的名字是"C♯"(C Sharp), 而不是"C#"。前一个是乐谱里常用的代表升半音的符号,后一个是表示数字的符号。

之所以经常被写成后一种,仅仅是因为#这个字符输入比较方便。


维基百科:

The name "C sharp" was inspired by musical notation where a sharp indicates that the written note should be made asemitone higher in pitch.[6] This is similar to the language name of C++, where "++" indicates that a variable should be incremented by 1.

Due to technical limitations of display (standard fonts, browsers, etc.) and the fact that the sharp symbol (U+266F music sharp sign (HTML: ♯)) is not present on the standard keyboard, the number sign (U+0023 # number sign(HTML: #)) 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.[5] However, when it is practical to do so (for example, in advertising or in box art[8]), Microsoft uses the intended musical symbol.

The "sharp" suffix has been used by a number of other .NET languages that are variants of existing languages, including J# (a .NET language also designed by Microsoft that is derived from Java 1.1), A# (from Ada), and the functional programming language F#.[9] The original implementation of Eiffel for .NET was called Eiffel#,[10] a name retired since the full Eiffel language is now supported. The suffix has also been used for libraries, such as Gtk# (a .NET wrapper for GTK+ and other GNOME libraries), Cocoa# (a wrapper for Cocoa).


参考资料:维基百科:C Sharp (programming language)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值