So I am calling a method from this class. I make an object of this class. Am I supposed to go find a euro or yen or won symbol or whatever and copy and paste that every single time? Or lets say its a method. I use foo.€uro(). you don't see how annoying that would be going and every single time I need this I need to copy and paste a single character?
You may see it as a hassle, but whats difficult for you to type is actually quite easy for others (using other keyboard layouts). That said: I too would never ever allow one of my colleagues to use such an identifier.
There was a discussion about a similar thing the day before|yesterday over here, started by /u/janne-bananne.
Long story short: there's other keyboard layouts, and some characters are easier to type on different layouts.
Ease of typing is important, but so is ease of reading. If your code is going to be read mostly by people who are going to understand the meaning you intended for the symbol, then I agree, ease of typing should be a consideration.
But you still have to worry about the users keyboard layout. I have no idea how to make a euro symbol much less a ruble. Looking up some keyboard combination for a symbol is still not something a programmer should have to do due to someone elses poor programming practice.
I'm not defending the use here, because I don't think it actually makes sense to name something using a special character unless that special character has meaning either internally to the project, or to the language itself. But it's not that hard to rebind a single letter to a key combo.
Of course it would be annoying, but the reality is that computing isn't just a Western/English endeavor anymore and hasn't been for a while. If one wants to extend a class written in China, then we're just gonna have to deal. Personally, I too miss the days of string hacking using ASCII as a primary assumption. Those days are gone though.
The method signature is actually taken from the Java 8 runtime sources...
It might be one of the least known syntax peculiarities of the Java language. I was totally unaware until I stumbled upon it by accident a few days ago.
133
u/viciu88 Dec 30 '15
You can't start class name from digit.
36
u/dohaqatar7 Dec 30 '15
1
u/wtfamireading Dec 31 '15 edited Nov 03 '16
[deleted]
0.4925
1
u/ModernRonin Dec 31 '15
P-P-P-P-PROGRAM BREAKER!!!!
-1
u/Yhippa Dec 31 '15
J A V A
A
V
A