Now blogging at diego's weblog. See you over there!

my favorite Java 5 change

I used Java 5 (with Eclipse 3.1) for the code I wrote last week to use as example for manifold, and there's no question: the enhanced for loop, combined with generics, rocks.

Aside from the basic difference of going from (Note, use of an inline iterator is also common):

//strings is an ArrayList
for (int i=0; i<strings.size(); ++i) {
String s = (String) strings.get(i);
//do something with s
for (String s : strings) {
//do something with s
there's also the cooler use of it to iterate over the contents of a HashMap, so instead of doing
HashMap m = new HashMap();
//fill the map with String, Vector values
Iterator it = m.keySet().iterator();
while (it.hasNext()) {
String key = (String);
String value = (Vector) m.get(key);
you can do
HashMap m = new HashMap();
//fill the map with String, Vector values
for (String key : m.keySet()) {
Vector value = m.get(key);
Which is much more concise, and clear IMO. Very cool.

Posted by diego on December 20, 2004 at 6:19 PM

a subtle problem of frontpage

As an aside, I spent some time in the last couple of days doing a favor to someone who had created a website but wanted to make it look reasonably good.

Since the site had been created with Frontpage, I had to go through the usual rigamarole of removing the extraordinary amounts of garbage that Frontpage inserts into the HTML. This was problem number one.

The 'subtle' problem though, was the UI. In the process of changing the site I of course redesigned the navigation, but I realized that Frontpage was actually doing something pretty terrible: creating a bad UI.

Frontpage automatically manages the creation and maintenance of navigation on a site. You can create the site hierarchy and FP will maintain links, etc. The problem is that the UI that FP generates is hierarchical, and it doesn't really do justice to the multidimensional nature of hypertext. It is, pretty much, a directory in HTML form. In many default FP templates, sub-pages are generated with "Up" navigation links along with the rest, which is not only ridiculous with HTML but also bad UI practice because the navigation bar changes content for every page you're in.

So my question is: can't Microsoft fix Frontpage so that it a) generates simple, CSS-based HTML and b) that the default templates include well-designed hypertextual UIs, rather than what it does today?

Or does Microsoft need a Firefox HTML Editing app that will wake up the Frontpage team, just as Firefox itself has resucitated the IE team?

PS: Frontpage is actually a product that Microsoft acquired in 1996 when they bought a company called Vermeer Technologies. The founder of Vermeer, Charles Ferguson, wrote a book about his experience, from founding to acquisition, called High Stakes, No Prisoners, which is fantastic. Recommended.

Categories: technology
Posted by diego on December 20, 2004 at 5:58 PM


After the attack on clevercactus last week, most of the service is back up. Some things are still missing (e.g., forums). In the meantime, I'm doing other stuff, talking to people, and preparing the blog/site for my thesis so I can stop mixing everything up here (I can already see entries with nothing but "just posted on...").

Blogflow is clearly erratic. Must be the cold. We've had our first subzero days recently.

Categories: personal
Posted by diego on December 20, 2004 at 5:53 PM

Copyright © Diego Doval 2002-2011.