On Sun, 6 Jan 2002 15:22, Steve Downey wrote: > > -----Original Message----- > > From: Peter Donald [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 05, 2002 9:53 PM > > To: Jakarta General List > > Subject: Re: More abuse of coding styles... > > > > On Sun, 6 Jan 2002 11:26, Steve Downey wrote: > > > Your javac has a configuration setting for the class names of inner > > > classes? Although the inner classes use a $ embedded, > > > > rather than as a lead > > > > > character. It's a similar issue. > > > > And whats that got to do with the price of fish? $ is not valid in > > identifiers in java language (but fine in .class file format). > > $ is a perfectly fine character in a java identifier. Even as the initial > character. That's why it's specifically mentioned in the sun coding style > guide. It's legal, but not meant for use by all. > IOW: > class $ { > public int $() { > int $ = 5; > return $; > } > > static public void main(String args[]) { > $ dollar = new $(); > System.out.println(dollar.$()); > } > } > > is legal. Ugly as hell. But legal.
hmm ... didn't know that ... wonder why when I decompiled some stuff with $'s in it it wouldn't recompile ... > > Sure it is - it makes it acceptable for them to write poor code. > > In what way does it make it acceptable for them to write poor code? For > example, the JSP spec reserves _jsp, jsp, _jspx and jspx for identifiers > used in the classes generated by the page compiler. What other way do you > propose to guarantee that the compiler won't generate names that conflict > with ones I declare in a page? you think global variables are good aswell? Theres plenty of mechanisms to avoid namespace collisions - none of which require any magic variable names be injected into a global namespace. -- Cheers, Pete ----------------------------------------------------------------------- | I thought there was a knob on the TV to turn up the intelligence. | | There's a knob called "brightness", but it doesn't work. | ----------------------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>