Sunday, October 29, 2006

I tried a T-Mobile Dash today...

But I think I'm going to take it back and get the Blackberry Pearl instead. I loved the rubber body and brushed metal front on the Dash. It feels very solid. Unfortunately, Windows Mobile sucks. It doesn't integrate well with OS X, at least not without 3rd party software. I need a device which is a phone first, not fifth; the numeric buttons on the Dash are so tiny. I found the UI difficult to navigate. Common tasks require multiple clicks, and you have to look at the screen because the icons change depending on what you've used recently. I constantly click the wrong options. The Wi-Fi sounded compelling at first, but I'm not convinced it's very useful. You can't use Wi-Fi to talk, and Edge is plenty fast for phone-based browsing. I'd also prefer something a little more Java friendly.

I'm replacing my RAZR due to the clunkiness of its UI and lack of horsepower. I want a sanely designed UI and a phone which doesn't crash when I browse simple web pages. Easier texting also sounds nice; I noticed the Blackberry only puts 2 letters on each button instead of 3. Is the Pearl a good choice, or should I consider the Samsung Trace instead? The Trace looks simple and elegant, and it has a 6 hour talk time. I do like my pocket space.

Update: I can't find much on the Trace, but almost everything I read about the Pearl is positive. Pearl it is.

If you accidentally close a tab in Firefox 2.0...

Ctrl+Shift+T reopens it (or Command+Shift+T on OS X). That's the key combo which opens a new tab, plus shift.

Thanks, Pat, for the tip.

Friday, October 27, 2006

Strike 3!!!

The Cardinals won the World Series at home! I can't believe I'm not in St. Louis right now.

Strike 2.

Runners on 1st and 3rd.

2 outs, top of the 9th.

The Cardinals are one out away from winning the World Series for the first time since 1982.

Thursday, October 19, 2006

Strike three!!!

The Cardinals are going to the World Series!

Strike two.

Mets have the bases loaded...

2 outs in the bottom of the 9th. Strike one...

Home run in the 9th!

3-1, Cardinals, top of the 9th in the deciding game of the Cards-Mets series.

Tuesday, October 10, 2006

Who's S3's daddy?

Jeremy and Dave figured out backing up to Amazon S3 is cheaper than running your own server. S3 charges $0.15/GB/month storage and an additional $0.20/GB transfer. On the other hand, Go Daddy only charges $0.06/GB/month storage, and you get 2 terabytes/month transfer for free. Jeremy calculated S3 will cost him $1,688 for 5 years. Go Daddy would only cost $719.40, a savings of $968.60, more than half. This doesn't even count the cost of restoring from an S3 backup: $25 for Jeremy's current 125 GB vs. free for Go Daddy. And Go Daddy supports a fairly widely adopted API: FTP.

I'm sure S3 uses replication while Go Daddy performs nightly backups, but I'll probably only back up at most once a day anyway.

Friday, October 06, 2006

Code Monkey Like You

Designed Inheritance

Martin Fowler compared Designed Inheritance to Open Inheritance. With Designed Inheritance, you either allow and design for class extension or prohibit it. Open Inheritance on the other hand leaves everything open to extension.

Martin focused on Designed Inheritance protecting users from sharp knives, but compatibility is the real issue at stake. Experts vs. non experts aside, Designed Inheritance helps API designers keep their promises.

If I modify a non final class in my library, I have to anticipate every possible way existing users may have already extended my class and ensure my change doesn't alter the behavior of their code. In the case of a widely used API like the JDK, you simply can't make a change if the remotest possibility of breaking someone exists, even if you're fixing a bug. When it comes to using the JDK, if someone can, someone did. You need a compelling reason to force users to modify and recompile working code.

Which approach is best? Neither. As with most design debates, it depends.

If you write a library where you don't have control over client code and you need to maintain compatibility, steer clear of unnecessary maintenance headaches and practice Designed Inheritance. Use interfaces generously so users don't need to extend your classes in the first place. If you allow users to extend a class, don't call non final methods from your constructor--you risk calling user code before their constructor executes. Many of the idioms in Effective Java target this audience.

If you're writing internal or application code, don't waste too much time defending against yourself and don't over design. Strike a balance between effort and usability and maintainability. Leave your classes open; don't bother with too many interfaces. You can always refactor later.

And don't bother taking sides.

Monday, October 02, 2006

The Java Closure Spectrum

I have little doubt Java 7 will introduce closures in one form or another, but which form exactly?

On one end of the spectrum, anonymous inner classes already take us part of the way today, but their clunkiness leaves much to be desired. On the other end, Neal Gafter et al proposed an ambitious, Ruby-like extension dubbed BGGA closures (short for Bracha, Gafter, Gosling, Ahe, the authors' last names).

You'll find the power to weight ratio along the spectrum between the current clunk and adopting the BGGA proposal non linear. In that vein, Josh Bloch, Doug Lea and I propose Concise Instance Creation Expressions (CICE).

Loosely speaking, simple syntax sugar for anonymous inner classes buys Java 90% of the power of BGGA closures while carrying only 10% of the weight. We think it's the "knee in curve" where we get the most bang for our buck.

As for that remaining 10%, while the other leading brand omits a class name and supports non local returns and limited custom control constructs, CICE closures strike a fine balance between brevity and explicitness and raise the already famous Java readability bar.

Without further ado, Concise Instance Creation Expressions: Closures without Complexity. Let us know what you think.