Skip to main content

Making trade-offs

Posted by daniel on July 3, 2003 at 5:31 AM PDT

An optimizing compiler often give you choices that include optimizing for speed or optimizing for code size. Discussions of improving code can not be separated from your objectives. If you are burning your application to a space constrained chip then size may be most important. If you are creating a highly responsive application, then aparant speed may be most important.

Before the compiler processes your code, you make choices at development time that may trade-off between readability and maintainability on one side and performance on the other. Paul Tyma believes performance over readability. His performance talk at this spring's SD West made this point clear as did the quotes from Paul that served as the basis for the recent controversial "Refactoring, Refactoring" article written by Robert Cringely.

To make code more performant, you generally have to make it less readable. Readability often involves introducing abstractions. You don't talk directly to your data base, you use JDBC. You don't follow pointers to find the next element in a collection, you ask the corresponding Iterator to return next(). The problem with this, according to Joel Spolsky, is that all abstractions leak. Today in Java Today Craig Castelaz discusses this balance in "Living with Leaks". Craig looks at Spolsky's Law of Leaky Abstractions and Keppler's continuum of abstractions that predates Spolsky's work by a decade.

In today's featured Weblogs "Open Source, P2P, Weblogs, and Slime Mold" contains Bob Rhubart's thoughts on swarm intelligence. Steven Johnson's book "Emergence: The Connected Lives of Ants, Brains, Cities, and Software" and a Berkeley site on slime mold are the launching points for Rhubart's blog. Chris Adamson begins his weblog "Shoeing the other foot" with the following great line:

Hey, I used to work in the wireless software industry... and of course, any sentence that begins with that phrase usually ends in "and we all got laid off". Which we did.

Chris is responding to Bill Day's blog that . Chris argues that Apple shouldn't be responsible for developing J2ME tools. More generally he asks with the J2ME Wireless toolkit isn't a pure Java application. Erik Hatcher's entry "The ServerSide Symposium debriefing" is a comprehensive description filled with links and references. Following his links is on my list of things to do.

In Also Today, we include three articles from the recent refactoring tempest. First read "Cringely's Refactoring Refactoring" for the article that started the controversy. Next, read Martin Fowler's response in "Refactoring Cringely." You may be surprised to find the number of issues on which these two articles agree. Finally, the Cringely article was a follow-up to his article on Open Source from the previous week. He made a comment on refactoring based on an email exchange with Paul Tyma. "Egging on Cringely" is a link to Tyma's blog on what happened.

Steve Mallett, the Java Today news editor has gathered the following Java Today News Headlines: "eBays J2EE backend serving over 400 million transactions a day", "Commons HttpClient 2.0 Beta 2 Released", "AltoWeb closes doors", and "Java Email Server 1.2.3 Released".

Once this page is no longer featured as the front page of Java Today it will be archived at You can access other past issues by changing the address appropriately.