Metacircular thoughts

November 28, 2007

Learning Lift – Step 0: Learn the Java platform

Filed under: Java, RIAs, Scala — metacircular @ 9:57 pm

Lift is a Scala web framework. Its creator is none other than the mighty David Pollak, a man who was a mature programmer when I was a newborn infant.

It combines many of the best ideas from other web frameworks. It’s at the point where it’s small enough to be manageable but large enough to be featureful. Now is the perfect time to get in on it.

The problem is that it until about a week ago, my computer couldn’t even handle Lift, I didn’t have enough RAM. That problem has been solved.

But I still don’t have a clue about Maven and the other Java components Scala depends on which I don’t think David even realizes are nontrivial to learn. (They are trivial if you are David Pollak.)

And besides, Lucene is too awesome to pass up.

So, the first step is getting comfortable with Java web programming.

To do this, I am going to create a wiki/PIM type product that is more or less a Backpack ripoff. It will start as a trivial wiki, with Backpack-type features added later. Here are some features that are essential:

  • Fulltext search. This is an essential feature of all modern data-driven applications. Lucene will do the job.
  • Version control. I insist on knowing who changed what and when on pretty much any digital artifact I work on on computers these days, even binary assets like Photoshop files.
  • Simplicity. It must be beyond braindead simple to jot down quick notes, as simple as it is to type in a query to Google.
  • Responsiveness. I fucking hate slow software! Unfortunately we will have to dirty our hands with JavaScript in order to carry out nice Ajax stuff. I hate Ajax hype more than anyone I know, but it’s simply a fact that client-side scripting is the way to make excellent, responsive web applications.

In order to make this tractable, Internet Explorer compatibility is entirely optional, and I’m not going to waste my spare time on it.

Probably mobile access is important but I barely ever use cell phones.

The book I’m going to be working through is a recent release from APress: Beginning JSP, JSF and Tomcat Web Development: From Novice to Professional.

Let the games begin.

February 19, 2007

A funny code snippet from the ThoughtWorkers

Filed under: Java, The Dark Side — metacircular @ 12:32 am

This is from a unit test in the source to CruiseControl.NET:

public void WhenTheConfigurationDoesNotContainDirectivesRelatingToShowingBalloonsItDefaultsToTrue()
...
public void CanProvideASetOfProjectStatusMonitors()
...
public void CreatesAnEmptySettingsFileIfTheConfigFileIsNotFound()

That’s auto-completion for you, I guess.

February 14, 2007

Daily WTF-worthy code from the Swing team

Filed under: Java — metacircular @ 2:45 am

I was feeling kind of shitty, it being Valentine’s Day and all, when I found this Java gem. The following Java code apparently accompanied a pug-fugly “Extreme GUI Makeover” of a simple email client at JavaOne 2005. This is how the Swing team codes.


while (!buffer.atEnd()) {
  if (buffer.get() == '\\r') {
    if (!buffer.atEnd() && buffer.get() == '\\n') {
      if (!buffer.atEnd() && buffer.get() == 'F') {
        if (!buffer.atEnd() && buffer.get() == 'r') {
          if (!buffer.atEnd() && buffer.get() == 'o') {
            if (!buffer.atEnd() && buffer.get() == 'm') {
              if (!buffer.atEnd() && buffer.get() == ' ') {
                return true;
              }
            }
          }
        }
      }
    }
...

Haven’t these people ever heard of loops? Thank god the header they were looking at was “From” and not “I-Am-The-Very-Model-Of-A-Modern-Major-General” or something, huh?

I think these people wrote their own email header parsing library when JavaMail has been around for years. That makes it double-Daily WTF material because of the awesome NIH factor. But JavaMail is a Sun product (so it actually was “invented here” in this case) and Sun employees apparently don’t know about it.

I’m speechless.

Next Page »

Blog at WordPress.com.