It does sometimes make sense to have identifiers in non-English languages. If could be for a DSL, or it could be because the business logic concerns concepts which is not trivially translatable to english.
And this works right until a developer who doesn't speak the language will have to deal with that code, which will happen much sooner than you'd expect. Half of the fun is figuring out the meaning of variable names, the other half is figuring out how to type ß on a non-German keyboard.
Minor side note: I cannot for the life of me figure out why other operating systems won't borrow Apple's fantastic input scheme, in which this something as simple as a ß isn't a big deal. Need an emdash? Easy, option-shift-minus. Need an ñ? Easy, option-n-n. ß, ≠, ¡, ÷ or any number of other relatively common symbols? Easy. Most of them are even fairly mnemonic (e.g. ß is option-S, ¡ is option-1, ≠ is option-= and ÷ is option-/).
Lion made this even easier by stealing iOS's input scheme: Hold down a keyboard key for long enough and you can pick a special character out of a context pop out. îïíīįì šéē
I wish JS was better-suited to embedded DSLs. But without operator overloading, with required parens on function arguments, no (standard) method_missing, no atoms, and a limited set of characters for identifiers, it's pretty limited.
Not disagreeing with the sentiment, but if you’re using Windows, Linux, or OSX, you do have a searchable character map.
That fails when you don’t know the name of the character, in which case you can use something like Shapecatcher (http://shapecatcher.com/), but then how do you know whether it’s a Greek theta or a Coptic thethe or a Cherokee na or Cyrillic fita or Latin barred O?
Clearly our editing powers need to improve if we’re to feasibly use non–English-alphanumeric variable names.
I tend to avoid that as inevitably when someone has to use the variable, it's a bugger to work out what to type unless you're a unicode whizz. I'd use "theta" instead.
Iunno, perhaps editors should just get better about supporting “special” characters. Programming language notation kinda sucks without proper symbols. Every time I type “->” or “<=” I have to sigh a little inside. Do we really need to be able to type code on 50-year-old typewriters?
Emacs is alright about it though. There are keybindings for entering Unicode characters by name or number, and for getting information about the character at the cursor. You can also use a TeX-like input mode where “\lambda” is automatically replaced with “λ”. But really, I’d rather we rethink input methods altogether.
An Identifier is an IdentifierName that is not a ReservedWord.
In .NET CLR languages, you can use Unicode for identifiers like in JS, but an interesting side-effect of the 'common' aspect of the CLR is that you can use reserved keywords too. This is because reserved words in one language are not necessarily reserved words in another language.
Someone could write the following valid definition in VB.NET:
Public Property ushort() AS Integer
And because it's a reserved keyword in C# you'd have to reference it using the '@' escape:
foo.@ushort = 123;
(There are probably far more confusing examples than this)
More descriptively, it's a aspirated unvoiced sub-apical palatal plosive.
If you wish to make the sound, position your tongue like you're trying to stick it down your throat. The bottom of the tongue should be touching the top of your mouth. Then, make a "tuh" sound. If you do it right, it should sound hollow and "harder" than a normal Englilsh "t" sound.
The most legitimate use for this is for top-level namespaces, which need to be short or they'll junk up your code like crazy. jQuery already took $, and Underscore took _. Maybe 木, ϗ, _⃗, 个, î, 人, Ǝ (not ∃, that's illegal!), ℵ, 二, ℜ, 龍, ℕ, 八, Δ, 大, ʃ, ː, 卐, or as mentioned below, λ? ˀ is probably too obnoxious though.
For no particularly good reason, ☺ and ☠ are illegal. I think the Plan9 strategy of considering non-ASCII characters as identifier characters by default is probably a better one than changing the language grammar every time the Unicode standard revs.
The tutorial about "How to write unmaintanable code" would love this. They already have some hints about putting accents on "int i" and other subtileties like that
For those who like SQLite, it allows you to create tables and columns with zero length names (you have to quote) and it does indeed work correctly when you use them. This is valid:
CREATE TABLE ""("" "");
A zero length table name with one column with a zero length name having a type of a zero length name.
As my father said "just because you can put your penis in a goat, doesn't mean you should".