Re:My Students Laugh, HaHa, Laugh, at the HN Naysayers ;)
by DanielRibeiro on Tuesday January 25, 2011 @08:38PM
(#2141732)
Not to mention that the type system in Java is always surprising. List<Integer> is not a List<Number> but Integer[] is a Number[] (which can throw ArrayStoreException as covariance makes no sense on mutable collections - ref: http://programming-scala.labs.oreilly.com/ch12.html )
And compare smalltalks' (and ruby's and python's) everything is an object to Java's: there are some primtive things, and null is not an object.
Don't get me wrong: java is very taughtable to beginners. The basic usage is ok, while cumbersome. But Java shows its deep issues when you start using it for more serious stuff.
When you're writing an algorithm to count words in a file, would you prefer
or How about introducing anonymous functions? How much time will it take you to explain the intricacies of creating an anonymous subclass whose only purpose for existence is to encapsulate a single instance with a single method, inside which all variables from the containing scope must be marked as final? Or would you prefer something like Smalltalk? Sure, students can wrap their heads around both. But the important thing is the concept, not the expression. After all, if they go on to program in the real world, they'll be adapting their knowledge to different languages.