Thursday, June 10, 2010

blogging is about complaining isnt'it?

And here I come, ma.
Scala is a beautiful language which compiles to JVM's or CLR's byte code. Cool? Cool. But it also means that it inherits all the ... little things from those VMs. And Java's biggest thingy I know so far is type erasure.
Compatibility with old code? Great. Support code for win3.1 apps in XP? Perfect idea for marketing dept.
Before getting out of home, check your winkdoodle, because 400 years ago someone didn't and got bitten by the dog. It was huge.
Well, they run XP code in VM on Vista-shmista these days, okay, an option. What do we have in java these days?

scala> List[Pair[String, Any]]("a" -> 2) match { case (h :: t) if h.isInstanceOf[Pair[Int, Any]] => "match!" case emp => "nada" }  :6: warning: non variable type-argument Int in type (Int, Any) is unchecked since it is eliminated by erasure
List[Pair[String, Any]]("a" -> 2) match { case (h :: t) if h.isInstanceOf[Pair[Int, Any]] => "match!" case emp => "nada" }
^
res1: java.lang.String = match!
And those people disallow me picking in nose and call that language type safe? Yeah! Way to go for the backward compatibility!

No comments:

Post a Comment