Java’s a dying language, right? Why not teach something more modern? Even if you keep the JVM, there’s JRuby, Groovy, Scala, Clojure, and many others. Outside the JVM, there’s C#, Ruby, Erlang, Haskell, all sorts of programming languages that A) are better than Java, and B) would teach the principles of programming in a much purer form. Why not one of them?
First, if you’re talking about “principles of programming in a much purer form,” then get C# the heck off that list. There is nothing at all pure about C#, especially in version 3.0 and later. Scala either, for that matter.
But yes, Java is certainly the new COBOL. Along every dimension by which programming languages can be measured, there are now other languages that soundly beat Java…except one.
I can say with confidence that Java’s going to be around, and Java jobs available, for another twenty years. I can’t say that about any of those other languages. When the JavaGuys are released from prison, they will (assuming they’re good enough) be able to get jobs writing code in Java. If they then want to improve themselves by learning another, more lucrative language in their spare time, they can do that.
But if I teach them a really cool programming language that employers aren’t going to need when they get out of prison, then I’m no better than the college professors who are crippling their students by teaching them mainly C and C++, with historical perspectives on FORTRAN, Ada, and Lisp. (All I can think is that C++ was the latest thing back when those professors got tenure, and now that nobody can fire them, they see no reason to take the trouble to learn even Java, much less anything “exotic.” Cynical? Perhaps; but then I’m a consultant who has to constantly work to keep myself marketable, lest I roll off an assignment and find nothing else waiting for me. Tenure is a trap, sez I.)
Here’s the mission statement we came up with for the JavaGuys, in increasing order of importance:
3. Treat them like adults, not like children. I assume they know better than anyone else what life decisions are best for them. I give them advice where appropriate, but there’s never any “you must” or “you must not.” (There is, of course, a waiting list of people to get into JavaGuys, and every seat in the class is vulnerable to somebody on that list who might fill it more productively than its current occupant.)
2. Set the course’s trajectory on a path that makes outside support as unimportant as possible. I’m a consultant; my schedule is not dependable. At any time I could be jerked away from them. If I have to leave, I want the JavaGuys to endure under their own power–perhaps with guidance a little less accurate than before, but with undiminished horsepower or enthusiasm.
1. Teach only things that will definitely help in getting a job upon release. Practice over theory–as a matter of fact, practice instead of theory except when theory is absolutely necessary to make practice understandable. These guys probably won’t learn big-O notation, but they’ll understand that an algorithm is slower the more nested loops it has. They won’t learn to write a mergesort, but they’ll learn how to write a
Comparator-based anonymous inner class to do custom sorting with Java’s
Collections.sort () method.
So…that’s why Java.