Skip to main content

Program like a Shaker

Posted by daniel on November 22, 2004 at 7:48 AM PST

Simple Gifts

The Shakers
were known for their design principles that featured simplicity and
utility. Their furniture is not ornate and yet it is beautiful,
elegant, and enduring. Because the function of an object is not
compromised by unnecessary add-ons, it is easy to see the purpose for
which a given object is intended.

In today's
, Tom Ball blogs href="">
'Tis a Gift to be Simple. Tom describes a coding episode where
he pulled complicated code apart to isolate classes to be more
easily tested. The next thing he knew the code itself was more
communicative and simple. What caught my eye was the following
paragraph in Tom's blog entry:

Some engineers pride themselves on writing complex,
hard-to-understand code, and sneer at simple code as being
"obvious". I believe that writing simple code requires extra work and
discipline, but that work is justified by the code's quality, ease of
testing and comprehension by my co-workers. When a design gets
refactored to the point where it is "obvious", it means that it's time
to move to other areas which are not so clear.

I spent some time this weekend unraveling Java code written by a C
programmer who is self-taught in Java. What the code did was pretty
cool and he used some Java constructs in fairly interesting, mature,
and clever ways. But the entire application consisted of one source
file containing three classes. The first class implemented five
interfaces which had little to do with each other. I'm not criticizing
his design - I'm just agreeing with Tom's post embracing

In other weblogs posts, Joerg Plewe writes about href="">Functional
Ant saying "Typical Ant projects are designed to deliver a single
jar as a result. One has to know how the name of the jar and the place
it is stored. But Ant can also be used in a more functional style
'returning' a rich set of results on a target invocation."

In Also
in Java Today
, the JDK comes with the command-line profiling
tool HPROF. Kelly O'Hair takes you through many of the options as
well as through a sample session in href="">
HPROF: A Heap/CPU Profiling Tool in J2SE 5.0 . He writes "HPROF
is capable of presenting CPU usage, heap allocation statistics, and
monitor contention profiles. In addition, it can also report complete
heap dumps and states of all the monitors and threads in the Java
virtual machine."

The href="">ONJava
Reader Survey is underway and available for a limited time. The
accompanying article href="">
Writing Your ONJava Wish List discusses how the results from the
survey are amassed, considered, and used to help determine the future
editorial direction of the site. As an added incentive, five
randomly-selected participants will win three O'Reilly books each.

In Projects and
, members of the href="">Java Games Community, Nokia
and Hong Kong-based SmartTone are pairing to create the href="">recent
announcement first commerical online mobile Java gaming
community, delivering rich mobile Java games with community
features like friend lists and instant messaging.

From the Mac Java
page: The Apple Developer Connection article href="">Optimizing
Your Application With Shark 4 shows how to use Apple's "Shark"
developer tool to profile running Java applications, including a
sample with deliberately mis-coded hotspots for you to find.

KirillCool observes that href="">
Java has no systematically based and tested mathematical packages
in today's
. " The majority of the scientific community write in
C++, MatLab and (believe it or not) Fortran . The later one has such
an extensive algorithmic database, that most of the modern algorithms
are based on this code (using an equivalent of JNI to access it). Try
to write a sparse-matrix linear equation solver in Java - it doesn't
even has a sparse matrix package. Well, for this matter it doesn't
even have a dense matrix package."

PeterKessler comments on the Mustang Roadmap. " There's a funny distinction between code -- which we do release --
and plans for code -- which we are reluctant to discuss. I'll see if I
can pry loose some rough schedule so you can plan your own work. You
might even find some holes in what we've planned, and step in to fill
the gaps."

In today's
News Headlines

Registered users can submit news items for the href=""> News Page
using our news
submission form
. All submissions go through an editorial
review before being posted to the site. You can also subscribe to
the href="">
News RSS feed.

Current and upcoming
Java Events

  • November 27 href="">Hong
    Kong JUG - J2SE 5.0 Update
  • December 6-9, 2004 href="">
    TheServerSide Enterprise Java Architecture Workshop
  • December 7-8, 2004 href="">Eighth Jini Community
  • December 13-17, 2004 href="">JavaPolis, 2004

Registered users can submit event listings for the href=""> Events Page using our href=""> events submission
form. All submissions go through an editorial review before being
posted to the site.

Archives and Subscriptions: This blog is delivered
weekdays as the
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

Simple Gifts