And on an unrelated note to my last topic, ahem ahem, being an engineer myself I sometimes speculate about making my life easier. Here’s a few things that would make my life easier coding in Java, above and beyond the cleverness in Project Coin and lambdas and all that fancypants stuff:
-
import Something as SomethingElse - so I don’t have to use the ridiculously longwinded or occasionally clashing names other developers give their classes. Same for static imports.
-
scoped public / private blocks - so I can stop typing “private” over and over and over again. I’d like to be able to say private { … }.
-
using object {} blocks. The most inner using block becomes the default resolution for method calls, as if you typed “object.” before any call. Easily escaped by using “this.” to refer to the outermost scope or just any other object of course. There can be no name conflicts simply because the using object always takes priority when attempting to resolve references - so your call to toString() is always going to end up as object.toString() when using a using block.
-
#define/undef, #ifdef/ifndef and #include. I know it’s heresy but on many occasions macro programming gets me better results. Especially when doing debug or release builds of classes - being able to #define DEBUG true before running javac just makes a lot of sense for me. Right now I have to manually edit a public static final boolean before I do an ant build to ensure all my extensive debugging code isn’t included in the final output.
Anybody got any other pet wishes?
I forgot structs / mappedobjects. But then that’s a given, right?
Cas