View mode: basic / threaded / horizontal-split · Log in · Help
January 02, 2006
Re: US/GB spellings in API design (OT)
"Chris Sauls" <> wrote in message 
> John C wrote:
>> What's the consensus for API spelling conventions? Should I use my native 
>> spelling, British English, or has programming all but standardised on US 
>> English?
>> Most APIs seem to use US spellings of words such as 'colour' ('color'), 
>> 'centre' ('center') and 'normalise' ('normalize'). Perhaps it's because 
>> the well-known ones are written in the US, for example Microsoft's SDK 
>> and .NET and Sun's JDK. And HTML is US English (align='center'; 
>> color='#CCCCCC'). But I have used some libraries that have British (or 
>> International) English spellings - Scintilla springs to mind.
>> Does it even matter, though? Should I just use whatever comes naturally? 
>> Which variant do non-English speakers use -- do you write letters, emails 
>> etc in British English but program in US English? Have I opened a can of 
>> worms (because Canadian and Australian English, for instance, borrow from 
>> both)?
> Personally, I would actually consider using D's 'alias' statements to 
> provide /both/ options.
> # struct Color { float red, green, blue; }
> # alias Color Colour;
> #
> # void setColor (Color x) { ... }
> # alias setColor setColour;

That's a nice solution. Thanks for the suggestion, I'll use it.

> I might even start doing this in my own projects, just... because.  And 
> now that you mention it, I'm actually somewhat curious as to just /why/ 
> HTML uses US spellings, considering it was a British advent.

I've gleaned that Berners-Lee handed development of HTML over to the 
Internet Engineering Task Force, who were US-based. As well as that, 
Netscape and Microsoft added proprietry extensions, some of which were later 
adopted as standard. So it's a bit of a mish-mash.

> On an unrelated note, anybody else watching the XHTML/2.0 draft?  Its... 
> interesting.
> -- Chris Sauls
Top | Discussion index | About this forum | D home