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.

Messages.format( "FILES_WRITTEN", files);

then becomes

Messages._( "FILES_WRITTEN", files );

combining this with the new static import feature from Java 1.5 (great timing 🙂 this becomes

import static api.cintoo.messages.Messages.*;

_( "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,

$( "FILES_WRITTEN", files);

looks perhaps more familiar with Prototype.js using $ and this also looks like templating engines as Velocity/ JSP.