Wednesday, December 10, 2003

Java slowly edging towards Perl world

according to Graham

Update

The new language features all have one thing in common: they take some common idiom and provide linguistic support for it. In other words, they shift the responsibility for writing the boilerplate code from the programmer to the compiler. Because the source code is now free of this boilerplate, it's easier to write and read. Because the compiler, unlike the programmer, never makes mistakes, the resulting code is also more likely to be free of bugs.


After reading this, Sun really are starting to get it. What's going on? Realizing how clunky Java is? Fear of C#?

These are great changes :


  • Generics : Finally!
  • Enhanced for : basically a "for each X in collection" operation. Finally!
  • Autoboxing : automatic type conversion between Integer and integer. Finally!
  • Typesafe enums : Enums that look like C++. Good. In fact I've been using Visual Basic recently, and somthing that's really jumped out at me is how handy a decent enum is. But this looks a lot more ambitious. I'd like to try it out. (Although that would mean writing Java again. :-(
  • Static import : One step closer to multiple inheritance ;-)
  • Metadata : Code generation is always handy, but let's see the tools ...

No comments: