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
Weblogs
, Tom Ball blogs href="http://weblogs.java.net/blog/tball/archive/2004/11/where_is_my_con.html">
'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
simplicity.

In other weblogs posts, Joerg Plewe writes about href="http://weblogs.java.net/blog/herkules/archive/2004/11/functional_ant.html">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="http://java.sun.com/developer/technicalArticles/Programming/HPROF.html">
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="http://www.zoomerang.com/survey.zgi?p=WEB223X7HZ42HJ">ONJava
Reader Survey is underway and available for a limited time. The
accompanying article href="http://www.onjava.com/pub/a/onjava/2004/11/17/survey-advancer.html">
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
Communities
, members of the href="http://community.java.net/games">Java Games Community, Nokia
and Hong Kong-based SmartTone are pairing to create the href="http://www.n-gage.com/en-R1/press/Press+releases/press_news_021104.htm">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
Community
page: The Apple Developer Connection article href="http://developer.apple.com/tools/sharkoptimize.html">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="http://forums.java.net/jive/thread.jspa?messageID=6413&tstart=0#6413">
Java has no systematically based and tested mathematical packages
in today's
Forums
. " 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 java.net
News Headlines
:

Registered users can submit news items for the href="http://today.java.net/today/news/">java.net 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="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net
News RSS feed.


Current and upcoming
Java Events
:

  • November 27 href="https://hkjug.dev.java.net/servlets/NewsItemView?newsItemID=1428">Hong
    Kong JUG - J2SE 5.0 Update
  • December 6-9, 2004 href="http://www.theserverside.com/architecture_workshop/index.html">
    TheServerSide Enterprise Java Architecture Workshop
  • December 7-8, 2004 href="http://jini.org/meetings/eighth">Eighth Jini Community
    Meeting
  • December 13-17, 2004 href="http://wiki.javapolis.com/">JavaPolis, 2004

Registered users can submit event listings for the href="http://www.java.net/events">java.net Events Page using our href="http://today.java.net/cs/user/create/e"> 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
Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of java.net it will be
archived along with other past issues in the href="http://today.java.net/today/archive/">java.net Archive.

Simple Gifts