Thursday, November 8, 2007

The Name Game: Improve on Map for Java 7

What's in a name? that which we call a map
By any other name would associate as sweet;
-- with apologies to The Bard

Kevin Bourrillion has posted a joint proposal for minor additions to some core APIs in Java 7.

This is pretty cool stuff:
  • The proposal itself smacks of being agile: it's small in length and in scope.
  • The changes address some corner cases in the vein of Java Puzzlers, and fill some inconsistencies in various APIs.
The most interesting proposal, IMHO, is #7. The idea is to have a new Map interface that is fleshed out with new methods (those from ConcurrentMap) and have all Map implementations use that new interface.

Of course, we need a name for this new interface. The doc has this line:

not likely to happen, due mostly to lack of tolerable name

Like many thoughtful developers, my reaction is:

  • No doubt, names are important, and vitally so for a core API.
  • Can I come up with a better name?
  • Can I come up with an absurd name? (Delightfully, they offer MapDaddy)
  • Why can't I stop thinking about this?
I could write an entire post about the importance of names and how much fun/challenging it can be to find just the right name.

What would you name a new Map interface? Here are some of mine
  • Dictionary. Has a classic appeal to it, but is already used (and deprecated) in the JDK.
  • Lookup. Another classic but somehow it doesn't seem strong enough. It seems like we should have a derivative of 'Map'.
  • Map7. The doc cites this as a bad name but it makes my shortlist, for some reason.
  • ReplaceMap. Probably too cute, the idea here is (a) the new methods involve replacement and (b) we are replacing the Map interface. At this point, one starts to realize how hard this task is. I can understand the reluctance expressed in the doc.
and some more yet:
  • iMap. That will get Apple's attention.
  • NüMap. Java has great support for Unicode, so let's go Euro. Plus we could sell lots of Java 7 schwag to heavy metal fans and feed the proceeds back into the Open JDK.
  • Map#. We need to grab mindshare from from the .NET crowd before F# takes off.
  • MapQuest or GoogleMap. Now, we're on to something: Java could be the first language to embrace corporate sponsorship in its core libraries. Call Nike and CocaCola immediately! (though they will probably want to brand the String class)
Your turn. What do you think?

3 comments:

  1. How about a splenderific word like Maptastic or Mapelicious?

    I just read an article about how the noun/verb approach to OOP is not necessarily the best way anymore, so lets start using adjectives. And ones we've made up, no less!

    ReplyDelete