I just finished reading a
very interesting
article
by Gregory Wilson that covers many issues that I feel strongly
about.  In a nutshell:

  • UNIX shells are a wonderful, albeit aging, invention.
  • COM is a very powerful framework that has enabled a formidable ecosystem
    of innovative technologies on the Windows platform.
  • No matter how hard we try, we don’t seem to be able to solve problems in
    only one language.
  • Even worse, we are increasingly mixing different languages in one source
    file.

My first observation is that this article fails to mention
MSH, Microsoft’s next
generation shell, which expands on the first two points by providing a type-safe
shell that formalizes the data that is exchanged through connecting processes. 
No more arcane and non-standard command-line switches, or hacks using regular
expressions to parse the output of all these tools.  MSH is a fascinating
tool and I’ll save its description to a future entry.

Gregory Wilson also makes the point that in the future, languages will be
stored internally in a neutral format and be shown to developers using their own
preferences.

A few weeks ago, I started working on an Eclipse plug-in that would allow me
to have properties in my Java files.  The following code:

private String m_name;

public String getName() {
  return m_name;
}

public void setName(String name) {
  m_name = name;
}

would appear in my editor as:

+ property String Name; …

This line would be folded by default and would be replaced with the full
declaration above if expanded.

How does this relate to the article above?  Quite directly:  with
this plug-in, I am transforming the Java syntax into my own.  I am using
the Java source as an internal format and using an IDE to present it to me in a
form that I find easier to read.

It doesn’t have to stop there.  Maybe you don’t like Java’s semi-colons
and braces and you prefer Pythons’ significant spaces instead:

if (m_suiteConfigurationFailed)
  result = false
else
   for(Object targetInstance : instances)
     m_method = new InvokedMethod(targetInstance
   result = true

As for Wilson’s basic point and the idea that all the programs in the
world can be expressed in XML and shown in a user-defined way, I am still very
skeptical.  It’s not so much about the read-only view but more about the
way people write programs.  New languages keep being created on a weekly
basis, and some of them bring new concepts with them, which won’t be adequately
captured by this universal XML format without modifying its semantic, which
brings us back to square one:  representations that are incompatible with
each other and programs that can only be read or saved with a specific version
of the representational language.

Another problem with Wilson’s approach is that developers spend a lot of time
reading other people’s code, which mandates the existence of a language that
everybody understands.  The tricks described above do not alter the Java
source, and the physical file can not only still be parsed and compiled by
javac
, it can also be understood by any Java developer.

But I believe there is some hope and some promise, and in the meantime,
nothing stops us from taking baby steps toward this destination, such as the
Property plug-in I described above.

How about you:  how would you like to see your Java programs
represented?