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

"Making" money with open source

Posted by staufferjames on June 12, 2007 at 7:33 AM PDT

How do you make money with open-source software?
You don't, you save money!

(Some companies do make money but many more companies could save money). More companies are concerned with using software than selling software.

Iterating: for vs. while

Posted by staufferjames on May 23, 2007 at 8:03 AM PDT

I often see code like this (when using Java 1.4 or earlier):

Iterator i = list.iterator();
while(i.hasNext()) {
...
}

but I write that as:

for(Iterator i = list.iterator();i.hasNext();) {
...
}

because
* It shorter
* It keeps i in a smaller scope
* It reduces the chance of confusion. (Is "i" used outside the while?

Selecting by first letter should show as many as possible that start with that letter

Posted by staufferjames on May 21, 2007 at 12:03 PM PDT

When I am in a drop down list and I press a letter to jump to the first entry that starts with that letter why does it leave that entry on the bottom of the visible entries?

Case of static method names

Posted by staufferjames on May 18, 2007 at 5:44 AM PDT

I like to make my static method names start with an upper case letter. I know that isn't standard and that only class names are supposed to start with an upper case letter but I find that it is helpful because it quickly shows which methods are static. Also, I have never confused a static method with a class because the usage/syntax is different.

Better stack traces

Posted by staufferjames on May 17, 2007 at 8:54 AM PDT

ClassCastException didn't used to have a message but I noticed that now it has a message that includes the cast class and the object class. That extra info is very beneficial. (Note that only recently could I start using 1.5 in my main product so I am behind the times a bit.)

What other common Throwables need improved messages?

NullPointerException should have the name of the variable.

Who should write documentation?

Posted by staufferjames on May 16, 2007 at 10:03 AM PDT

Do developers write good product documentation? Is someone who knows a product inside and out the best person to document it?

Have you ever bought a product and you could obviously tell that the manual writer didn't speak the language natively?