We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Unicode variable names
Page Index Toggle Pages: 1
Unicode variable names? (Read 756 times)
Unicode variable names?
Dec 5th, 2009, 3:35am
 
Java supposedly supports unicode variable names?

Processing does not allow it though, huh? Bummer!

I would love to shorten my code and have single character pet names for stuff on my larger, longer lasting projects.
Re: Unicode variable names?
Reply #1 - Dec 5th, 2009, 3:36am
 
check out this site on the topic:
xahlee.org/java-a-day/unicode_in_java.html
Re: Unicode variable names?
Reply #2 - Dec 6th, 2009, 8:29am
 
really?? how sad
Re: Unicode variable names?
Reply #3 - Dec 7th, 2009, 2:02am
 
Well, I don't see the interest to have code like:
Code:
    List<String> \u611b = new ArrayList<String>();
\u611b.add("foo");
Object[] \u6850 = \u611b.toArray();
System.out.println(\u6850.length);

And if you put real Unicode characters in the code, you have to specify, eg. -encoding UTF-8 option to make the compiler to understand it (something not specified by the page you link to...).

Beside, it looks cool and funny, but this is good only if you think you won't share your code with anybody, except perhaps people speaking the same language as you: too often in this forum I see people showing code with identifiers and/or comments in a foreign language, and it makes very hard to properly read their code.

Actually, except with newbies code, I never see anybody using these facilities. Sometime I find open (?) source with comments in Japanese or other language, but nearly never with Unicode identifiers (which is rarely allowed by programming languages anyway).
Page Index Toggle Pages: 1