I had always wondered if it was .NET alone that had inspired Sun to add generics to Java. Perhaps, as you will see here, there was a little more to the story!
On slide 24 I mention Philip Wadler and Martin Odersky. At this point in the talk I repeated an anecdote that Wadler told me. After they had done the work on generics, Odersky was hired by Sun to write the new Java compiler. He thought the generics were a good idea, so he put them into the compiler. The Sun folks always ran the compiler with the generics turned off. But they couldn’t rip out the generics completely, because they needed them in the compiler in order to get it to compile its own source code, which was written with generics. So they had to leave the feature in, and eventually they started using it, and eventually they decided they liked it.
4 thoughts on “Funny story about the Java compiler”
there is javaposse interview with Odersky where he talks about this -genercis were working at 1.3 (!) and a stealth community was using them, but Sun became aware of this and forced them to strip generics out
interesting blog (but if i may be so bold -terrible photo you -you look like you are off to the prom!)
Re: Odersky, interesting!
Re: my photo, thanks for your candor (aka boldness). I take it you aren’t commenting on my youthful appearance, as that would be a compliment! :). There is always this one that is on the same page: https://www.wisdomandwonder.com/wp-content/uploads/2008/08/grantrettkebc2mke.png
Bonus points for you if post your blog photo advice here :).
in fairness, i should direct you to my photo solution
would you buy a used closure from this man..
> would you buy a used closure from this man..
Depends on how many times it has been re-entered 🙂