Re:Double Brace Initialization in Java
by tzs on Sunday August 19, 2012 @04:42AM
(#4403585)
I know this is blasphemy in the Java world, but I'd probably use a preprocessor to transform some clean syntax into the normal Java code. I'd rather have the slight increase in build complexity over the potential issues with the extra classes and the breaking of assumption about how things compare and such.
[ Parent
| on HN ]
Re:Double Brace Initialization in Java
by guard-of-terra on Sunday August 19, 2012 @08:27AM
(#4403841)
Your IDE would complain all the time. Seriously, you lose one of a few good parts, stellar IDE support. Why bother with Java then?
Something like Xtend ( http://www.eclipse.org/xtend/ ) ?
Re:Double Brace Initialization in Java
by warmwaffles on Sunday August 19, 2012 @12:41PM
(#4404457)
Never heard of this. Thanks
I have always been extremely tempted to just throw together a quick and dirty preprocessor in maybe Awk for the few personal projects that I've used Java for. It would just make everything so much nicer.
Re:Double Brace Initialization in Java
by ExpiredLink on Sunday August 19, 2012 @08:49AM
(#4403866)
> I'd probably use a preprocessor to transform some clean syntax into the normal Java code.
If I were in your place, I'd just learn enough Java to be proficient. Java is a very powerful language and certainly better suited for mundane tasks than your preprocessor.
Re:Double Brace Initialization in Java
by mindslight on Sunday August 19, 2012 @11:05AM
(#4404186)
I think you misunderstood; he wants to avoid doing mundane tasks.
There's a couple of extensible preprocessors that aim to do exactly this. They're called 'clojure', 'scala', and 'kawa'.