Recently in Technical Category

The Abomination of Anonymous Inner Classes

| No Comments
I have long held the opinion that the feature of anonymous inner classes in Java (and, truly, any language) are an abomination, an unnatural perversion having no place amongst all things Holy and True.  There are others who share this opinion of mine, for various reasons.

My primary reason for having such a severe dislike of those things is because they completely destroy the flow of the code.  In the middle of a method -- nay! even worse -- in the middle of a method call, suddenly there's code being laid out which will be executed in some other flow, most likely through some other thread -- nay! still worse -- suddenly there's another class being defined!  Lordy lord, what horrible thing to do to your code!

Let's look at a simple little example:

public class FindConfigFiles
{
  public void loadConfigFiles (File basePath)
    throws IOException
  {
    File[] configFileLIst = basePath.listFiles(new FileFilter ()
      public boolean accept (File toCheck)
      {
        return toCheck.getName().endsWith(".xml");
      }
    );
      :
  }
}


EEEK!  Don't do that!  Blech! Blech! Blech!

Instead, consider something like this:

public class FindConfigFiles
{
  static protected class ConfigFileFilter
      implements FileFilter
  {
    public boolean accept (File toCheck)
    {
      return toCheck.getName().endsWith(".xml");
    }
  }

  public void loadConfigFiles (File basePath)
    throws IOException
  {
    File[] configFileLIst = basePath.listFiles(new ConfigFileFilter());
      :
  }
}


Ahhhh.  Much better.  Just the act of turning that anonymous inner class into a named inner class worked magic on that little snippet of code.

That particular inner class only sported one line of meaningful code.  Now imagine if the code in the inner class had to be a bit more involved.  Even if the inner code were as small as 5 lines, the impact is still staggering.

You know, when all is said and done, the thing that really confuses me about this is that it seems most Java engineers don't even notice, or perhaps simply don't care, about the defilement they are incorporating into their very own code.

Ubuntu Karmic Sucks - Notification Tray Fix

| No Comments

A few days ago I bitched and moaned about Karmic coming with notification tray icons that make my computer look like a 1995 cell phone.  (Notification Tray Rant)

Shortly after I posted that, I found a fix.  You know, fix is kind of a funny word.  It can mean a whole swarm of things besides just "repairing something that was broken."  It can be a bad situation ("I'm in a real fix now"), cheating ("That race was fixed"), revenge ("She fixed him good"), a drug dose ("Just one fix, pleeeeeeaze"), or even a reference to castration ("Chip's been fixed, poor dog").

In this case, I think almost all of those definitions apply.  I fixed it.

I found the steps below on some guys blog.  I have no idea what the search terms ended up being that yielded this page, but I know it was a bit circuitous.  I'd love to give the guy credit, but I can't find the page again.

Anyhow, here are the steps.  This is basically just installing different desktop themes.

gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -
sudo apt-get update
sudo apt-get install zgegblog-themes

Once them themes are in place, open up your Appearances dialog (System ⇒ Preferences ⇒ Appearances) and choose one.

This works both with and without Compiz Fusion.

Huzzah!  Take THAT Karmic!

Ubuntu Karmic Sucks - Notification Tray Rant

| No Comments
For the first time in many years, the latest and greatest version of Ubuntu is actually worse than it's predecessor.  I installed Karmic onto my Dell laptop over New Years weekend, and I was very disappointed.

stupid-karmic-notification-tray-icons.pngI have a long list of complaints about the beast, but today I just want to rant about the butt-ugly notification tray icons.  I'm talking about these guys over on the right.

Now, to set the stage a bit, my laptop is a modest old Dell Inspiron 1525.  It's actually a hand-me-down from my wife.  It was not top of the line even when we bought it a little over 2 years ago.  But even this antiquated beast is capable of displaying at least 16-bit color depth at 1280x800 WXGA resolution.

Why then am I stuck with flat gray-on-gray icons?

These icons are reminiscent of days-long-past when cell phone displays could only show simple, predetermined images in predetermined locations.  In those days, these icons were the best visual presentation those poor little phones could present.  These are not those days, and those limitations are no longer limitations.

I know that designers so often love to give retro-feel to things.  It's like an urge they get that they just can't seem to deny for very long.  Like a need that can only be denied for a short period of time before it must be addressed.  Like having to pee.

And once they give in to this need, once they decide to design something in a retro-style, a wave of relief flows through them, sending shivers up their spine.  But don't be fooled.  They just peed.

So, lest I continue to ramble on about this, let me get to the point:

Designers, I want icons that make it look my machine is even cooler than it actually is, not icons that make my machine look like an old phone.

Meanwhile, I'm gonna go see if I can figure out how to hack better icons into place.

Update: Go see the Fix.

About this Archive

This page is an archive of recent entries in the Technical category.

Shirts is the previous category.

Writings is the next category.

Find recent content on the main index or look in the archives to find all content.