Method names in Java can be named _ and why static import is a good thing
When formatting messages with Messages.format code becomes quite noisy. So I thought why not use a special char for the method name? I used “_” which seems to be unintrusive.
then becomes
combining this with the new static import feature from Java 1.5 (great timing :-) this becomes
_( “FILES_WRITTEN”, files);
which looks shorter and less noisy than the first and as the default Sun solution for i18n.
I think about using “$” for the method name,
looks perhaps more familiar with Prototype.js using $ and this also looks like templating engines as Velocity/ JSP.
You can leave a Reply here. Of course, you should follow me on twitter here.
You’re kidding right? You think a method name of _ is a good thing? Then hiding it with a static import is a good thing?
It’s not april fools day. Where’s the “I’m Kidding” at the end of the entry?