Archive for December, 2004

IntelliJ IDEA is free too

Tuesday, December 28th, 2004

People talk a lot about how Eclipse is so great because it’s free. IntellIJ IDEA is free if you’re willing to test the alpha/beta versions. The final releases (like 4.0 and 4.5) cost money, but with the Early Access Program you get to use a great IDE and have some input on how the product will turn out.

The EAP builds are usually stable, and you get to use new cutting edge features (refactorings, code inspections, etc.) sooner than you would otherwise.

To download IntellIJ IDEA 5.0 Early Access, visit http://intellij.net/eap/. You’ll have to sign up for an EAP account, but after that it’s an easy download and install.

Google Suggest and GMail are a step backwards

Saturday, December 18th, 2004

People have been posting a lot about how cool they think GMail is, and how amazing Google Suggest is, and how XmlHttpRequest is going to change our lives, and I can’t take it anymore, I have to say something.

UPDATE: I’ve posted a follow-up to this article which explains more about why I think the web is not a cool platform for complex applications.

Part 1: GMail is a step backwards

People like GMail’s interface for some of these reasons:

  1. It organizes e-mail into “conversations” so you can see how a series of e-mails progressed, and logically organize your e-mails
  2. You can “Archive” e-mails instead of deleting them, so you can look through them later
  3. You can search through your old e-mails
  4. You can apply colored labels to messages automatically based on rules
  5. It filters spam mail

My response to each of these features, respectively:

  1. Netscape Mail / Mozilla Mail / Thunderbird has done this for years
  2. Netscape Mail / Mozilla Mail / Thunderbird has done this for years
  3. Netscape Mail / Mozilla Mail / Thunderbird has done this for years
  4. Netscape Mail / Mozilla Mail / Thunderbird has done this for years
  5. Netscape Mail / Mozilla Mail / Thunderbird has done this for years

(more…)

What Java generics needs

Wednesday, December 1st, 2004

I’ve been using Java 5’s generics a lot lately, and I’ve been thinking about what about the design works, and what needs improvement. Here’s a list of some things I think Java’s generics needs.

1. Cleaner syntax

My main problem with generics is that the syntax is so verbose. For example:

private Set<OutputPortValueListener<? super V>> listeners
    = new CopyOnWriteArraySet<OutputPortValueListener<? super V>>();

I think there needs to be a way to tell the compiler to figure out what the type arguments for some things must be, like this:

private Set<OutputPortValueListener<? super V>> listeners
    = new CopyOnWriteArraySet<...>();

The compiler could easily figure out what the “…” needed to be replaced with.

2. Stronger inference of generic type arguments

Java’s type inference is intentionally weaker than it could be. In fact, it is weaker than it was before 5.0’s release. Sun’s compiler team decided it would be too difficult to document the advanced type inference capabilities of javac in the Java Language Specification, so they simply removed them. Now, code like this won’t compile, when it would have with earlier versions of javac:

SortedSet<Map.Entry<Integer,Port<?>>> entries
         = new TreeSet<Map.Entry<Integer,Port<?>>>(KeyComparator.getInstance());
...
class KeyComparator<K extends Comparable<? super K>>
        implements Comparator<Map.Entry<K, ?>> {
    public static <K extends Comparable<? super K>> KeyComparator<K> getInstance() {
        return new KeyComparator<K>();
    }
    public int compare(Map.Entry<K, ?> entry, Map.Entry<K, ?> entry1) {
        return entry.getKey().compareTo(entry1.getKey());
    }
}

To compile, the underlined part needs to be replaced with “KeyComparator.<Integer>getInstance()”, because javac can’t figure out that it needs the <Integer> type argument. As I said, earlier versions of javac didn’t need the explicit type argument for this type of inference.

3. Inferred type bounds

As I’ve shown already, right now javac requires you to be verbose in your generics code in several ways. Another way is with generic type bounds. The following code will not compile:
(more…)