编程语言中字母大写的经验法则

发布于 2024-07-26 21:30:48 字数 1432 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(9

断桥再见 2024-08-02 21:30:49

在人类杀死最后一只恐龙后不久,随着小写字母键盘的发明,Lisp 社区从 LISP 转向了 Lisp

The Lisp community has switched to Lisp from LISP with the invention of lower caps keyboards shortly after mankind killed the last dinosaur.

苍风燃霜 2024-08-02 21:30:49

FORTRAN、LISP 和 COBOL 是缩写词:

FORTRAN: 公式翻译/翻译器

LISP: 列表处理

COBOL: COMmon 面向业务的语言

BASIC:初学者的通用符号指令代码

等等。

FORTRAN, LISP, and COBOL ARE acronyms:

FORTRAN: Formula Translation/Translator

LISP: LISt Processing

COBOL: COmmon Business-Oriented Language

BASIC: Beginner's All-purpose Symbolic Instruction Code

Amongst others.

天煞孤星 2024-08-02 21:30:49

其中一些与语言版本有关(即 FORTRAN 77 与 Fortran 90)。 来自 Fortran 维基百科条目(重点是我的):

从 FORTRAN 77 开始,该语言的早期版本的名称通常全部大写(FORTRAN 77 是在关键字中使用小写字母的版本,严格来说是不标准的)。 从 Fortran 90 开始的新版本中,大写字母已被删除。官方语言标准现在将该语言称为“Fortran”。 由于 FORTRAN 一词的大写(或缺少大写)在实际使用中从来都不是 100% 一致,并且由于许多人对此问题抱有热情的信念,因此本文并没有试图成为规范,而是采用了使用全部大写的惯例FORTRAN 指的是 FORTRAN 到 FORTRAN 77 的版本,标题大写的 Fortran 指的是从 Fortran 90 开始的 Fortran 版本。 此约定反映在 ANSI X3.9-1966 (FORTRAN 66) 和 ANSI X3.9-1978 (FORTRAN 77) 标准中 FORTRAN 的大写字母以及 ANSI X3.198-1992 中 Fortran 的标题大写 ( Fortran 90) 标准

当我看到 FORTRAN 时,我想到的是固定间距、打孔卡、非动态内存以及我口中的糟糕品味。 Fortran 意味着诸如用户定义类型、模块、数组内部函数之类的东西,而且还不错。

Some of it has to do with the version of the language (i.e. FORTRAN 77 vs. Fortran 90). From the Fortran Wikipedia entry (emphasis mine):

The names of earlier versions of the language through FORTRAN 77 were conventionally spelled in all-caps (FORTRAN 77 was the version in which the use of lowercase letters in keywords was strictly nonstandard). The capitalization has been dropped in referring to newer versions beginning with Fortran 90. The official language standards now refer to the language as "Fortran." Because the capitalisation (or lack thereof) of the word FORTRAN was never 100% consistent in actual usage, and because many hold impassioned beliefs on the issue, this article, rather than attempt to be normative, adopts the convention of using the all-caps FORTRAN in referring to versions of FORTRAN through FORTRAN 77 and the title-caps Fortran in referring to versions of Fortran from Fortran 90 onward. This convention is reflected in the capitalization of FORTRAN in the ANSI X3.9-1966 (FORTRAN 66) and ANSI X3.9-1978 (FORTRAN 77) standards and the title caps Fortran in the ANSI X3.198-1992 (Fortran 90) standard.

When I see FORTRAN, I think fixed-spacing, punch cards, non-dynamic memory, and a bad taste in my mouth. Fortran means things like user-defined types, modules, array intrinsic functions, and isn't so bad.

牛↙奶布丁 2024-08-02 21:30:49

要将另一个添加到列表中,MATLAB 应该全部大写拼写。 由于它是“矩阵实验室”的缩写,所以有些人倾向于将其写为MatLab。 其他人只是将其写为Matlab或matlab,但这些在技术上都是不正确的。

To add another to the list, MATLAB is supposed to be spelled with all caps. Since it is short for "matrix laboratory", some people tend to write it as MatLab. Others just write it as Matlab or matlab, but these are all technically incorrect.

邮友 2024-08-02 21:30:49

显然,很多人不知道为什么,并将他们找到的所有简短的编程语言名称都大写。 一个可悲的例子是 Lua,人们经常无缘无故地写成 LUA。

请注意,某些语言名称具有内部大写,这是由于它们的构建方式所致,而且只是因为制造它们的公司希望这样。 例如 JavaScript 和 PostScript,或 ActionScript(我是否看到其中的模式?)。 或者你有一个奇怪的组合,比如 ECMAScript(是的,我看到了一个模式!)。

Apparently, lot of people doesn't know why, and capitalize all short programming language names they find. A sad example is Lua, too often written LUA for no reason.

Note that some languages names have internal capitalization, due to the way they were build, and well, just because the company making them wanted them this way. For example JavaScript and PostScript, or ActionScript (do I see a pattern there?). Or you have a strange mix, like ECMAScript (yes, I see a pattern!).

半衬遮猫 2024-08-02 21:30:49

因为它们是事物的缩写,但归根结底这并不重要。 它们只是名字。

例如,

LISP =“列表处理”,

而 Java 只是名为 Java,它不代表任何东西。 它曾经被称为橡树,因为给它命名的人在他的办公室外面有一棵橡树。

维基百科是一种语言,您会找到答案。

Because they are acronyms for stuff but at the end of the day it doesn't matter. They're just names.

E.g.

LISP = "LISt Processing"

Whereas Java for example is just named Java - it doesn't stand for anything. It used to be called Oak because they guy who named it had an oak tree outside his office.

Wikipedia a language and you'll find your answers.

我喜欢麦丽素 2024-08-02 21:30:49

规则就是没有规则。 并不是有一个学院或其他管理机构来规定人们如何称呼他们的编程语言以及如何拼写它。 每个人都为自己的语言制定自己的规则。

通常,如果您撰写有关此内容的文章,您要么遵循房屋风格指南,要么查找它的官方名称。

您看到如此多不同用途的原因是大多数人不关心或只是无知。 我仍然想知道谁曾告诉任何人将 Macintosh 计算机称为“MAC”,但这种拼写很普遍。 我猜有些人就是喜欢他们的 Shift 键。

The rule is that there is no rule. It's not like there is an Academy or other governing body that rules of what people get to call their programming language and how they have to spell it. Everyone makes up their own rules for their own language.

Typically, if your writing about this stuff, you either follow a house style guide or lookup the official name for it.

The reason you see so many different uses is that most people don't care or are just ignorant. I still wonder who ever told anyone to refer to a Macintosh computer as "MAC", yet that spelling is pervasive. Some people just love their shift keys, I guess.

巾帼英雄 2024-08-02 21:30:49

如果全部大写,则它(应该是)缩写词。

If it is in all caps it is (supposed to be) an acronym.

-黛色若梦 2024-08-02 21:30:49

if 变量名 == 变量名
打印“使用大写字母”
别的
print“遵循团队的编码标准”

if variableName == VARIABLENAME
print "USE CAPS"
else
print "Follow your team's coding standards"

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