Saturday, May 06, 2006

Java coding style

Here's the style I prefer these days.
package org.example.myproject;

import java.io.IOException;
import java.util.Map;

import org.apache.log4j.Logger;

import org.example.myproject.util.MyUtil;

/**
* This class does several things.
*
* @author name@domain.com
*/
public class MyClass {

public static final String PUB = "a";

private static final String PRIV = "b";

private String _name;

private String _description;

/**
* Construct a new MyClass.
*/
public MyClass(String name, String description) {
_name = name;
_description = description;
}

}


Thursday, May 04, 2006

Writing a search engine

I just remembered this story...

Back in '96, I was part of a small team working on the HP support website. We had just started to look at incorporating a search engine and had hired Verity to integrate their search software with our site.

One afternoon, Jim, the project manager for search, invited a few of us to attend a Verity training session. I was really curious about how these search engine things worked, so I was happy to attend.

Derrick, the consultant, had given us a nice introduction to inverted indexes and stopwords, and I was intrigued. Ten minutes in, I stopped listening and started typing. Shortly afterward, Jim noticed I wasn't being as attentive as the others. He came over and asked me what I was up to.

"Oh, I'm writing a search engine in Perl"

Poor Jim.