Funny story about the Java compiler

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”

  1. 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!)

    pete F

  2. > would you buy a used closure from this man..

    Depends on how many times it has been re-entered :)

Leave a Reply

Your email address will not be published. Required fields are marked *