Skip to main content

James Stauffer

James Stauffer is a senior software engineer for SPS Commerce. His 14 years there have been mostly maintaining and enhancing one Java enterprise web application. He wasted almost all of his money from high shool graduation gifts adding a 16 MB RAM chip to a Windows 3.11 machine that already had 4 MB and learned the important lesson of "right sizing".

 

staufferjames's blog

IDE simple test

Posted by staufferjames on August 21, 2007 at 8:36 AM PDT

One way that I evaluate a new IDE is by opening a file in a fresh install and determining how much I can do with that file. Obviously features that need to know about the other files in the project won't work. I recently tried to use NetBeans and JDeveloper to generate getters and setters.

Communicating between anonymous inner classes

Posted by staufferjames on August 17, 2007 at 9:17 AM PDT

Here is a quick tip:
Do you have two anonymous inner classes that need to communicate? I had two anonymous inner classes that implemented Runnable and needed to communicate with a boolean value.

Method return values for null objects

Posted by staufferjames on July 31, 2007 at 6:04 AM PDT

Would it be useful to be able to provide method return values for null objects?
For the List interface, the null return values might include:

get(int) : null

size() : 0

iterator() : An empty iterator

That would allow the following code that has less null checks:

Automatic casting

Posted by staufferjames on July 26, 2007 at 4:50 PM PDT

Is there any downside or problem potential to changing the Java compiler to automatically cast? In the example below the result of list.get(0) would automatically be casted to the type of the variable hi (String).

Little-known but great IDE's

Posted by staufferjames on July 23, 2007 at 7:24 AM PDT

I use Source Insight as my primary IDE.

Code search

Posted by staufferjames on July 19, 2007 at 12:27 PM PDT

Searching my code and other files outside my IDE is something that I need to do often but I haven't found a good solution.

Replace across files from the command line

Posted by staufferjames on July 2, 2007 at 12:00 PM PDT

Some of my co-workers had their cvs login name changed so we had the problem where every directory checked out from cvs had a CVS subdirectory with a Root file in it that had the old username.

Don't return in a finally clause

Posted by staufferjames on June 27, 2007 at 9:46 AM PDT

The code below actually prints "yikes!"

Declaring variables

Posted by staufferjames on June 25, 2007 at 7:51 AM PDT

A pet peeve of mine is when a variable is declared way before it is needed. It is much easier to understand a piece of code if a variable is declared just before it is needed.

Dragging in UI

Posted by staufferjames on June 19, 2007 at 12:01 PM PDT

When the user drags an item to a location, slows movement, and then makes a quick movement right before finishing the drag, the user probably wanted the ending location to be the mouse location right before the quick movement. The user should be prompted for which target they want if the quick movement changed the target.