> Scala is anything but dynamically typed! One of the criticisms of that > article was that the type system is too imposing. Which is is, if you only > try and understand it by reading the language specs and not by e.g. actually > trying to program something in Scala. In practice, it gets out of your way > very nicely.
I've found that to be true, but I find myself able to understand the type systems of C# and of Haskell (ok, not everything) simply by reading the language spec. Less true of Java, but I had 10 years less experience when I first read Java's than when I first read C#'s. There are things I would happily remove from Scala's type system and it could be that Java's real successor will be something like Scala, but minus a few features. Here's what I'd kill: View types - nobody knows what they are but they knock a bunch of lines off a number of use cases. Implicit conversions - the main use case is to do what C# does with extension methods, and those are simpler. I'd keep implicit parameters, but only just. The many and varied uses of underscore, _. Just write 'ignored' instead [for most uses]. Self types. I don't care much about OOP (not to say I'm in the immutable-only camp), and those seem only useful in that. The encoding I'd normally use is more like Java's Enum type (trait Foo[F <: Foo]) but when I'm coding without enforced designs, which is luckily all the time now, it just doesn't come up. Incomplete pattern matches - those should just be a compile error, as should an incomplete switch over an enum in Java. Existential types. Wildcards were a mistake in Java, they don't really need to be copied over. There are reasons for not having 100% compatibility, and sanity is one of them. It's not part of the type system, but I'd also drop the XML literals as I think pretty much everyone using Scala today would too. They are probably *the* best advert for continuous code review I can think of (the literals aren't bad but the code backing them is). I think that without those features, sure, some code would be longer but I don't think it would be disastrous and it would be much easier to learn the language. That said, you can learn the language today and ignore all those features, but some libraries will make that difficult as they rely on the features. -- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
