<< Closures In Java 7: It's On Again | Home | Wednesday Java Quiz: What Does It Print? >>

Relentless Reduction Of Complexity

[Note] I started this blog 7 days ago but didn't finish it on time. I'm finishing it up now. The current date will be November 13, 2009 starting from the next sentence.

"Relentless reduction of complexity" is a phrase I picked up from Alex Payne's keynote at the Strange Loop 2009 conference 21 days ago. Of all the things that was said during conference, this phrase resonated with me the most.

Yesterday, at the St. Louis JUG, Brian Gilstrap gave a very well thought-out, compelling presentation on RESTful Web Services using JAX-RS and Jersey. While the overall subject is interesting, it is a "little" comment that Brian made that struck me: "I created a mini-framework just so that I don't have to repeat the same line of code in every class."

Then, as if to reinforce this Minimalist theme, Richard Bair of the JavaFX team posted Looping in FX today in his and Jasper Potts's FX Experience blog in which he outlined the evolution of loop construct in the JavaFX SDK, going from a Java-ish

public function hideAll():Void {
    for ( i in [0..sizeof this.childrenPopups] ) {
        if (this.childrenPopups[i].visible) {
            this.childrenPopups[i].hideAll();
        }
    }
    hide();
}

to a JavaFX-ish

public function hideAll():Void {
    for (p in childrenPopups where p.visible) {
        p.hideAll();
    }
    hide();
}

In both Brian's and Richard's instance they have achieved "code that works" first, but their professionalism and pursuit of excellence carried them further, to make the code simpler and more elegant.

I admire their approach to writing great code profoundly. And I think producing not merely passably working code but elegantly organized crystal clear code is a trait that serious programmers should acquire, perfect, and make a habit.



Re: Relentless Reduction Of Complexity

I was present at both events and also noted the comments made by both presenters, although I didn't make the same association. I'm in favor of reducing complexity and creating frameworks to isolate code and promote reuse, but I'm not sure they are equivalent. It seems to me, creating a framework reduces complexity for the user (and possibly for the maintainer, since code is isolated) but in fact, the complexity has only been moved - it's still there, just relocated. Maybe this is nit picking. After all, the big payoff is reducing complexity for users of your code. Just letting my mind wonder.

Add a comment Send a TrackBack