I just took online (non-course related) test on C# and this question came up to me:
Are there any difference to the C# language based on country/region?
No, there are no differences whatsoever. There is just one language specification. Period.
Imagine what happens to a programming language specification that changes depending on the region you are in...
What if this has a different meaning in the USA then in Europe:
decimal d = 1.500;
Is it 1.5 (one and a half) or 1,500 (one thousand five hundred)?
double.Parse("1.5");
will work, regardless of the environment, while in many European countries this will fail. I agree that's not part of the language. But is something one should take into account.
Oct 15, 2014 at 18:33
Well the DateTime
typesetting will be different depending on the culture. For instance in the U.S., it will read, the same goes with currencies, dialogs (the YesNo
buttons will be different, etc.):
10/15/2014 8:16:08 PM
Whereas in France it will read:
15/10/2014 20:17:08
Example (with the csharp
interactive shell):
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.Threading;
csharp> using System.Globalization;
csharp> Console.WriteLine(DateTime.Now);
10/15/2014 8:18:12 PM
csharp> Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");
csharp> Console.WriteLine(DateTime.Now);
15/10/2014 20:18:46
In short all settings that depend on a country/culture/natural language will be set locally (as @joppiesaus mentions, Europeans use a comma where Americans use the "decimal dot"). But the compiler is uniform.
Note however this has nothing to do with C#
itself. After all C#
is a standardized language with a deterministic virtual machine. But the "environment" in which it runs, can set default values differently.
Finally, as @philippelhardy indicates, there are some patents that can cause problems. For instance Mono is a clone of C#. While Microsoft Silverlight can play DRM protected media files, Mono's Moonlight can't, because Microsoft didn't license their PlayReader. See here for more information.
The short answer is no. It's a programming language and I don't see why it would be different in other countries.
The long answer is no, but there are some differences(not in the programming language itself, thought).
For example: I live in the Netherlands, so the computer sees me like I'm Dutch. If I enter Convert.ToDouble(someString)
, in the US the .
would seperate the number, while in Europe the ,
seperates the number.
That's related to the culture the program is running in(CultureInfo
), which is partly based on region(pre-installed computers, internet, ...)
System.Globalization.CultureInfo.CurrentCulture
. It's not inferred from your location (hopefully).