国标英语还是美式英语?

发布于 2024-07-06 15:45:12 字数 299 浏览 5 评论 0原文

如果您有一个 API,并且您是一位拥有高度国际化受众的英国开发人员,那么您的 API 应该是

setColour()

setColor()

(以一个单词作为简单的例子。)

英国工程师通常对自己的“正确”拼写非常谨慎但可以说美国拼写在国际市场上更为“标准”。

我想问题是这重要吗? 其他地区的开发人员是否会遇到 GB 拼写问题,或者通常情况下它们的含义是否很明显?

都应该是美式英语吗?

If you have an API, and you are a UK-based developer with a highly international audience, should your API be

setColour()

or

setColor()

(To take one word as a simple example.)

UK-based engineers are often quite defensive about their 'correct' spellings but it could be argued that US spelling is more 'standard' in the international market.

I guess the question is does it matter? Do developers in other locales struggle with GB spelling, or is it normally quite apparent what things mean?

Should it all be US-English?

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

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

发布评论

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

评论(28

何以畏孤独 2024-07-13 15:45:12

我倾向于使用美国英语,因为这已成为其他 API 中的标准。 作为一名英语程序员,我在使用“颜色”等方面没有任何问题。

I would tend to use US-English as that has become the norm in other APIs. Speaking as an English programmer, I don't have any problem using "color", for example.

没有心的人 2024-07-13 15:45:12

我不是母语人士。 在写作中,我总是尝试使用en-gb。 然而,在编程中,我总是使用 en-us 而不是英式英语,其原因与我不使用德语或法语作为标识符的原因大致相同。

I'm not a native speaker. In writing, I always try to use en-gb. However, in programming I always use en-us instead of British English for much the same reason that I don't use German or French for my identifiers.

吾家有女初长成 2024-07-13 15:45:12

一般来说,我会坚持 GB 拼写,但我认为如果代码一致的话,代码读起来会好得多,并且我发现:

Color lineColor = Color.Red;

看起来比:

Color lineColour = Color.Red;

我想最终这并不重要。

Generally I would be a stickler for GB spelling but I think that the code reads a lot better if it is consistent and I find:

Color lineColor = Color.Red;

to look a lot better than:

Color lineColour = Color.Red;

I guess that ultimately it doesn't really matter.

梦里兽 2024-07-13 15:45:12

取决于您在哪里见到大多数客户。 我个人更喜欢在我的私人代码中使用 English-GB(例如 Colour),但对于外部发布的应用程序/API/代码,我会使用 Color!

Depends where you see most of your customers. I personally prefer using English-GB (e.g. Colour) in my private code, but I go to Color for externally published applications/API/code!

一直在等你来 2024-07-13 15:45:12

尽管我通常对正确的拼写非常迂腐,但作为一名英国开发人员,我总是会选择美国的“颜色”拼写。 在我遇到的所有编程语言中,都是这样,因此为了保持一致性,使用“颜色”很有意义。

Even though I'm usually very pedantic about correct spelling, as a UK developer I would always go with the American 'color' spelling. In all programming languages I've encountered, it's like this, so for the sake of consistency, using 'color' makes a lot of sense.

陌上青苔 2024-07-13 15:45:12

假设这是一个 Java 或 C# API,考虑到 IDE 中自动完成功能的普遍性,这可能并不重要。 如果这是一种动态语言或现代 IDE 不常见的语言,我会使用美式拼写。 当然,我是美国人,因此显然有偏见,但我从非英语母语的开发人员那里看到的大多数代码似乎都使用美国拼写作为变量名称等。

Assuming this is a Java or C# API it probably doesn't matter given the pervasiveness of auto-complete functionality in the IDEs. If this is for a dynamic language or one where modern IDEs aren't the norm I would go with the American spellings. Of course I am an American and am therefore obviously biased, but it seems like most of the code I see from developers who aren't native English speakers use US spellings for their variable names etc.

嘿嘿嘿 2024-07-13 15:45:12

作为一名英语程序员,我使用 en-US 进行软件开发。 美式英语在几乎所有其他 API 中都占据主导地位,因此更容易坚持一种拼写类型并消除歧义。 寻找一种方法却发现由于拼写本地化而导致拼写有一个字母的偏差,这是浪费时间。

As an English programmer, I use en-US for my software dev. American english dominates so well in almost every other API that it's much easier to stick to one type of spelling and remove the ambiguity. It's a waste of time searching for a method only to find the spelling is off by one letter due to spelling localisations.

新人笑 2024-07-13 15:45:12

我会遵循现行标准并选择美国英语拼写。 HTML 和 CSS 是公认的拼写“颜色”的标准,其次,如果您正在使用像 .NET 这样的框架,那么您很可能已经在不同的名称空间中拥有了可用的颜色。

必须处理两种拼写的精神负担会阻碍而不是帮助开发人员。

Label myLabel.color = setColour();

I would go with current standards and pick the US English spelling. HTML and CSS are acknowledged standards with the spelling "color", secondly, if you are working with a framework like .NET then chances are you already have color available in different name spaces.

The mental tax on having to deal with two spellings would hamper rather than help developers.

Label myLabel.color = setColour();
唐婉 2024-07-13 15:45:12

我在使用非美式英语的 API 时遇到问题。 只是因为拼写差异。 我知道这些词的意思,但不同的拼写让我困惑。

我熟悉的大多数库和框架都使用美国拼写。 当然,我是美国人,所以...美式英语是我的母语。

I have trouble with APIs that are not in US-English. Just because of the spelling differences. I know what the words mean but the different spelling trips me up.

Most of the libraries and frameworks I'm familiar with use the US spellings. Of course, I'm an American so... US-English is my native language.

牵强ㄟ 2024-07-13 15:45:12

我得到了另一个示例:序列化和序列化。 :)

就我个人而言,我认为这并不重要。 我参与过使用英国英语拼写国家的项目,而他们也使用英国拼写。 它仍然是英语,而且由于智能感知,这并不重要。

I got another sample: Serialise and Serialize. :)

Personally, I don't think it matters much. I've worked on projects that were using UK-English spelling countries and they use the UK spelling. It still is English and it doesn't really matter much due to Intellisense.

陌生 2024-07-13 15:45:12

大多数开发文档(就像 MSDN)都是美式英语。

因此,如果您的目标受众是国际受众,那么最好保持主流并在 API 中使用美式英语。

The majority of the development documentation (just like MSDN) is in American English.

So it might be better to stay with the main-stream and use American English in your API if you are targeting international audience.

-黛色若梦 2024-07-13 15:45:12

作为一名加拿大人,我经常遇到这种情况。
对我来说,输入“颜色”非常困难,因为我的肌肉记忆一直在输入“u”。

然而,我倾向于采用图书馆的语言。 Java 有 Color 类,所以我使用颜色。

As a Canadian, I run into this all the time.
It's very difficult for me to type "color" as my muscle memory keeps reaching for the 'u'.

However, I tend to adopt the language of the libraries. Java has the Color class, so I use color.

旧街凉风 2024-07-13 15:45:12

如果可能的话,我会尝试寻找替代词。 我会让-ize滑动。 对于颜色,我可能会使用色调、墨水、前景/背景...

如果没有,作为一个英国人,我会使用 en-GB,因为我对我的国家和起源还有一些自豪感。

然而,如果它是一个更大项目的一部分,尤其是国际项目,我会保持整个项目的一致性,其中一小部分采用一种语言变体,其余部分采用另一种语言变体。

I try to find alternative words if possible. I will let -ize slide. For Colour I could possibly use Hue, Ink, Foreground/Background...

If not, as an Englishman, I will use en-GB because I have some pride left in my country and origins.

If it was to be part of a bigger project however, especially an international one, I would keep the entire project consistent above having a small part be in one language variation and the rest in another.

孤星 2024-07-13 15:45:12

我也将不得不站在美式英语一边,只是为了保持一致(正如其他人已经在这里指出的那样)。 虽然我的母语是美式英语,但我曾与德国和瑞典软件公司做过软件项目,在这两种情况下,我的队友偶尔都会受到诱惑,在代码中使用德语或瑞典语文本——通常是为了注释,但是有时也用于变量或方法名称。 尽管我会说这些语言,但这确实很刺眼,并且让新的非语言者加入到项目中变得更加困难。

大多数欧洲软件公司(至少是我合作过的那些)的行为方式都是一样的——代码保持英语,仅仅是因为如果有其他程序员加入,这会使代码更加国际化。 不过,内部文档通常倾向于用母语完成。

也就是说,这里的区别是两种不同的英语方言,这并不像在同一个源代码文件中看到两种完全不同的语言那么极端。 所以我想说,保留美国英语的 API,但如果更适合您,请使用英国英语的评论。

I'm also going to have to side with US-English, simply to keep things consistent (as others have already noted here). Although I am a native US-English speaker, I have done software projects with both German and Swedish software companies, and in both cases the temptation occasionally would strike my teammates to use German or Swedish text in the code -- usually for comments, but sometimes also for variable or method names. Even though I can speak those languages, it's really jarring on the eyes and makes it harder to bring a new non-speaker into the project.

Most European software companies (at least the ones I've worked with) behave the same way -- the code stays in English, simply because that makes the code more international-friendly should another programmer come on board. The internal documentation usually tends to be done in the native language, though.

That said, the distinction here is about two different dialects of English, which isn't quite as extreme as seeing two totally different languages in the same source code file. So I would say, keep the API in US-English, but your comments in GB-English if it suits you better.

枯叶蝶 2024-07-13 15:45:12

我想说看看您语言中的其他库如何选择并遵循他们的约定。

编程语言及其内置 API 的设计者做出了选择,无论用户是否国际化,他们都习惯看到与此选择一致的拼写。 您的目标不是不同语言的使用者,而是编程语言的用户。 他们很可能已经从内置 API 中学到了相当多的外语单词,并且他们可能不知道美国英语和英国英语之间存在差异。 不要通过改变池塘的两侧来迷惑它们。

我主要使用 .NET 语言,.NET Framework 使用美国英语拼写。 在这个平台上,我会坚持使用美国英语。 我不知道有任何语言在 GB 英语上标准化,但如果您的语言已这样做,那么请务必与该语言保持一致。

I'd say look at how other libraries in your language choose and follow their convention.

The designers of the programming language and its built-in APIs made a choice, and whether the users are international or not they are used to seeing spellings consistent with this choice. You are not targeting speakers of a different language but users of a programming language. Odds are they've learned quite a few words in the foreign language from the built-in APIs, and they might not be aware there's differences between US English and GB English. Don't confuse them by switching sides of the pond.

I use .NET languages primarily, and the .NET Framework uses US English spellings. On this platform, I'd stick with US English. I'm not aware of any languages standardized on GB English, but if yours has done so then by all means stay consistent with the language.

流星番茄 2024-07-13 15:45:12

我同意“去美国”剧团的观点。 我自己在写电子邮件等时更喜欢 en-GB,但美式英语几乎是所有编程圈的标准。

I agree with the "go for American" troupe. I myself prefer en-GB when writing e-mails and such, but American English is pretty much the standard in all programming circles.

清风夜微凉 2024-07-13 15:45:12

尽管世界各地都使用英式英语,但我还是建议使用美式英语,就像其他人所说的那样,美式英语在市场上占据主导地位。

Even though British English is what is spoken throughout the world - I recommend using American English which like other people have said dominate the market.

囍孤女 2024-07-13 15:45:12

我听说选择美国英语而不是英国英语的主要原因是因为英国受众在面对美国拼写时意识到它是美国应用程序(或假设是这样),而美国受众面对英国拼写时认为“..嘿,这是错误的......这是颜色而不是颜色'

但就像其他人所说的那样,标准化。 选择并坚持下去。

The main reason I've heard for choosing US over UK English is because the UK audience, when confronted with US spelling, realise it's a US application (or presume it is so), whereas a US audience confronted with UK spelling thinks '... hey, that's wrong.. it's color not colour'

But like others have said, standardise. Pick on and stick with it.

草莓酥 2024-07-13 15:45:12

对我来说,用英国英语工作是很自然的事,甚至不需要考虑。 但是,如果您正在开发内部程序,那么这并不重要。 如果您正在创建将公开使用的 API,并且您的受众是国际性的,为什么不同时实现两者呢?

It comes naturally for me to work in UK English without even thinking about it. However, if you are developing internal procedures it doesn't really matter. If you are creating APIs that will be used publicly, and your audience is international, why not implement both?

爱的故事 2024-07-13 15:45:12

肯定是美式英语。

Definitely US english.

清浅ˋ旧时光 2024-07-13 15:45:12

首先,我在美国。 在我当前的项目中,它始终是“颜色”,但是,我们似乎无法选择拼写的单词是“灰色”与“灰色”。

实际上已经变得很烦人了。

First, I'm in the US. In my current project, it's always "color" however, the word we can't seem to pick a spelling for is "grey" vs "gray".

It's actually gotten quite annoying.

番薯 2024-07-13 15:45:12

我就是这样的人之一,每次我被迫在设置文件等中使用美式英语时,心率和血压都会升高,因为该软件没有提供英式英语的选项,但这只是我:)

然而,我个人对此的看法是提供两种拼写,给它们 setColor() 和 setColour(),在其中之一中编写代码,然后让第二个拼写传递参数。

通过这种方式,你可以让两个群体都感到高兴,尽管你的智能感知时间会更长一些,但至少人们不会抱怨你使用了“错误”的语言。

I'm one of these people who's heart rate and blood pressure rises each time I'm forced to use American English in setup files, etc, due to the fact that the software doesn't give the option for British English, but that's just me :)

My personal opinion on this one however would be to provide both spellings, give them setColor() and setColour(), write up the code in one of them, and just have the second one pass the parameters through.

This way you keep both groups happy, granted your intellisense gets a bit longer, but at least people can't complain about you using the 'wrong' language.

ζ澈沫 2024-07-13 15:45:12

我总是使用 en-GB 进行所有编程。 我想这是由于英国小说的影响很大。

但是,是否不可能有两组不同的 API(一组用于 en-US,一组用于 en-GB)在内部调用相同的函数? 但这可能会使头文件膨胀,所以可能取决于预处理器定义、条件编译? 如果您使用 C++,您可以执行如下操作...

#ifdef ENGB
     typedef struct Colour
     {
      //blahblahblah
     };
     void SetColour(Colour c);
#else
    typedef struct Color
    {
      //blahblahblah
    };
    void SetColor(Color c);
#endif

根据客户端程序员是否定义 ENGB,如下所示,

#define ENGB

他可以在他喜欢的文化中使用 API。
也许为了这样一个微不足道的目的而太过分了,但是嘿,如果它看起来很重要,为什么不呢! :)

I always use en-GB for all my programming. I guess it's due to a heavy influence of British novels.

However, might it not be possible to have two different sets of APIs (one for en-US, one for en-GB) which internally call the same function? This might bloat the header files though, so maybe depending upon a preprocessor definition, a conditional compilation? If you're using C++, you could do something like below...

#ifdef ENGB
     typedef struct Colour
     {
      //blahblahblah
     };
     void SetColour(Colour c);
#else
    typedef struct Color
    {
      //blahblahblah
    };
    void SetColor(Color c);
#endif

Depending upon whether the client programmer defines ENGB or not as below

#define ENGB

he could use the APIs in the culture that he prefers.
Maybe overkill for such a trivial purpose, but hey, if it seems important, why not! :)

九八野马 2024-07-13 15:45:12

标识符名称的语言选择与受众无关,而与开发框架或 API 的原始语言有关。

我不懂的语言不多,但我想不出有一种语言使用美国英语以外的语言。

恕我直言,由于不同的拼写而引入微妙错误的危险太大了。

函数重写很容易成为伪重载。

由于拼写差异,配置文件可能会变得无效。

可能会出现使用多个类(同时使用 en-US 和 en-GB)定义同一概念对象的情况。

因此,无论一段代码是纯粹供内部使用还是供外部使用,所使用的拼写必须始终与平台/框架/编译器/API 的原始语言相匹配。

Selection of language for identifier names has nothing to do with audience and everything to do with the original language in which the framework or API was developed.

I don't know very many languages but I cannot think of a single one that uses anything other than US English.

The dangers of introducing subtle bugs due to different spellings are too great IMHO.

A function override can easily become an pseudo-overload.

A config file could become invalid due to difference in spellings.

A situation might arise where the same conceptual object has been defined using multiple classes, using both en-US and en-GB.

So therefore, whether a piece of code is purely for internal use or intended for external use as well, the spellings used must always match the original language of the platform/framework/compiler/API.

柏林苍穹下 2024-07-13 15:45:12

如果您所有的程序员都是英国人,请使用 en-gb。 如果您的代码将被英国以外的程序员看到,那么 en-us 将是更好的选择。

一个小问题是,我们依靠翻译服务将我们的文档复制成其他语言。 我们发现使用 en-us 作为源时可以获得更好的翻译。

If all of your programmers are British, use en-gb. If your code will be seen by programmers outside of Britain, then en-us would be a better choice.

One minor point, we rely on a translation service to copy our documentation in to other languages. We have found we get better translations when using en-us as the source.

━╋う一瞬間旳綻放 2024-07-13 15:45:12

你需要考虑你的受众。 谁将使用该代码以及他们期望看到什么?

我在一家在加拿大和加拿大均设有办事处的公司工作。 我们。 在制作加拿大版文档和代码时,我们使用加拿大拼写(与英式英语非常相似),而在美国使用的则使用美国拼写。

有些东西是跨国界的,但拼写上的差异很少是问题。 当美国人不知道加拿大英语和英国英语的不同拼写时,它实际上可以产生一些有趣的对话。 有时他们对此表示同意,有时他们坚持将其更改为“正确”的拼写。 这也会影响日期格式(加拿大的 dd/mm/yyyy 和美国的 mm/dd/yyyy)。

当出现僵局时,我们通常会使用美国拼写,因为加拿大人熟悉这两种变体。

You need to consider your audience. Who is going to use the code and what are they expecting to see?

I work in a company that has offices in both Canada & US. We use Canadian spelling (very similar to British English) when producing documentation and code in Canada and US spelling for what is used in the US.

Some things cross borders, but the difference in spelling is rarely an issue. It acutally can generate some interesting dialogue when American's are not aware of different spellings for Candian and British English. Sometimes they are OK with it, othertimes they insist on it changing to the "correct" spelling. This also affects date formats (dd/mm/yyyy in Canada and mm/dd/yyyy in US)

When there is an impasse, we typically go with the US spelling since the people in Canada are familiar with both variations.

为人所爱 2024-07-13 15:45:12

我更喜欢美式英语。

I prefer US English.

旧时浪漫 2024-07-13 15:45:12

如果你回顾几百年,你会发现这种变化与美国毫无关系,尽管很多人都这么认为。 这些变化源于欧洲的影响,尤其是法国的影响。 在此之前,英语单词“color”实际上拼写为“color”。

试图标准化是徒劳的,因为一半的中国孩子正在学习欧洲之前的影响和美国对英语的理解,而另一半则按照今天的样子接受英语。

如果您认为语言是一个问题,那么您应该考虑重600克的台湾公斤。 我还没有弄清楚他们是如何做到这一点的,但我希望他们永远不会被雇用为飞机加油人员!

If you look back a few hundred years, you will find the change has nothing at all to do with the US, much as many would think so. The changes stem from European influences, particularly the French. Before that time, the English word "colour" was then actually spelt "color".

To try to standardise would be futile as half of Chinese children are learning the pre European influence and US understanding of English, while the other half are taking it up as it stands today, as the English language.

If you think language is a problem, then you should consider the Taiwan Kg which weighs in at 600g. I've yet to find out how they managed that one, but I hope they are never employed as aircraft fuelling personnel!

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