March 2004 Archives

What does the word "generic" promise?

| 4 Comments

Bruce Eckel, author of Thinking in Java has a controversial blog entry about generic types in Java 1.5.

I believe that Bruce has largely missed the point of Java's generics, and that the "latent typing" ideas he discusses would take Java in a very unJava-like direction. His post turns into something of a rant, but the crux of it seems to be this:

I feel lied to (by the term generic)

Basically, Bruce had heard about generics in Java 1.5, but had not yet read about them. The use of the word "generic" gave him a very mistaken idea about what this language feature actually entails. And then when he actually sat down to study generics in Java he was sorely disappointed.

I don't want to debate Bruce's other points here. I am curious, however, whether anyone shares Bruce's concern that the term "generic" when applied to Java's parmeterized types, promises something beyond what Java delivers. I haven't read Bruce's books, but he's presumably a pretty smart guy. If he's gotten this confused by the use of the word, I wonder whether others share his confusion. If the term "generic" is confusing, I'll want to avoid it in the next edition of Java in a Nutshell, or at least include a footnote about the potential confusion.

If you're familiar with generics in Java 1.5, and have used a similar facility in another language, your comments are encouraged!

Java 1.5 Enum Line Noise

| 5 Comments

Tim Peierls, a colleague on the JSR-201 expert group, shared the following Java enumerated type declaration with me. He described it as "line noise":

enum _{_,;;}    

(Remember line noise? I think it has been a decade since I last used uucp or had to manually debug a ppp connection by sending atdt to the modem, so I don't see much line noise these days...)

Tim's examples always seem insightful or instructive. This is one of them, and it highlights a couple of important points about the syntax of enum declarations. So let's take this declaration a token at a time.

Updated Examples from Java Examples in a Nutshell

| 3 Comments

If you're a reader of my book Java Examples in a Nutshell, and have previously downloaded the examples from this site, you may want to grab them again from http://www.davidflanagan.com/javaexamples3. A few of the examples require auxilliary properties files, which I forgot to include originally. Thanks to Ronald Tosh for pointing this out. The new .tar.gz and .zip archives contain the required properties files.

Books

ECMAScript 5 & HTML5!

"A must-have reference"
Brendan Eich,
creator of JavaScript

JavaScript graphics makes web programming fun again!

Read Less, Learn More

Comprehensive coverage of Ruby 1.8 and 1.9

"The New Most Important Ruby Book"
Peter Cooper,
rubyinside.com

The classic Java quick-reference

About

Advertising

Pages

Hosted By

Powered by Movable Type 4.21-en