Don't Interview the Engineer

This post is advice for managers looking to hire good engineers.  If you put a lot of value in the quality of the job interview, you might be selecting for the wrong kind of candidates. Continue reading

Posted in Resource | Tagged , , , | Leave a comment

Return Null or Exception?

I am writing a getter function, and the requested object can not be found.  Do I return null?   Or do I throw an exception?  The answer is “it depends.”  Sometimes both options are needed, but how to decide? Continue reading

Posted in Coding, Example Code, practice | Tagged , , , | Leave a comment

Variable Names & Key Values

Constructing JSON in Java can be a bother.  The most standard JSON library requires objects to be created, and then called to put the members on there.  So much easier in JavaScript, but it is not Java script.  Still, one technique to improve the readability is to name the variable in java to match the key in JSON.   Simple concept, easy to do, I sometimes wonder why it is not obvious to all. Continue reading

Posted in Coding, Example Code | Tagged , , , | Leave a comment

Write Bug Reports to Last

Encountered a bug report that cited a problem in “the new build.”   That is not good enough, because every week will bring a new “new build.”
Continue reading

Posted in practice | Tagged , , | Leave a comment

Keep Things the "Same"

This general design principle does not mean to never change anything, but to consciously create a paradigm where the same things have the same names and are accessed in the same way as much as possible. Continue reading

Posted in Coding, Design | Tagged , , , | Leave a comment

Java TimerTask Implementation Pattern

When implementing a TimerTask class, there are a couple of things to remember. Continue reading

Posted in Uncategorized | Leave a comment

Simple Rule for Exception

If you want a program that runs reliably, then there is a simple rule to follow about exception handling.   It is so simple, it can be stated in a single sentence:   if a method does not accomplish what it is supposed to do, it must throw an exception.   Continue reading

Posted in Uncategorized | Leave a comment

Poor Exception Handling Examples

Having just written about JSON error messages and exceptions, I did a small survey to see what others were doing, and I saw some of the most egregious examples of poor coding.   Sloppy exception handling makes programs that behave bad when the network runs into problems, and causes no end of suffering.  Here are some poor examples and why they are bad. Continue reading

Posted in Uncategorized | Leave a comment

Ultimate Java Exception Class

This is the third in a series about translatable exceptions (see Translatable Error Messages).  This post is about the class JSONException which contains the required features. Continue reading

Posted in Coding, Design, Uncategorized | Tagged , , , | Leave a comment

Exception Receiving

When you make a web service call, you want to report the problem to the user save as you do for any other part of the program, and that is through an exception object.  This post talks about converting the JSON received back into an exception object so that it can be reported properly.  This is the fourth post in a series about translatable errors for REST web services. Continue reading

Posted in Coding, Design | Tagged , , , | 1 Comment