Category Archives: Design

Code Only What You Need

Only commit to code that which needs to committed to code.  Only write what needs to be written.  How hard can that be?  You might be surprised, but there are developers out there that are so enamored with the code … Continue reading

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

Error Message Video

Here is a video tutorial giving an overview of the error message problem.

Posted in Coding, Design, Poor Error Msg | Tagged , , | Leave a comment

Numbered Error Messages Do Not Work

As part of a series of posts about error messages, this post covers a very specific claim: a single error message picked from a list of error messages is a bad idea and produces poor error reporting.  We start with … Continue reading

Posted in Coding, Design, Poor Error Msg | Tagged , , , | Leave a comment

Canonical Execution Error Example

If we are going to talk about error messages, we need to flesh out a typical computation scenario within which an error occurs.  I use this example in other places to talk about possible error messages.

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

Don’t Use java.util.Optional

This is a class that attempts to replace null with different way to check for null.  While I can imagine some very rare cases that this could be useful, in general it is more complicated, slower, and takes more memory … Continue reading

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

Catching Generic Exception Classes

In Java you can have a try statement with multiple catch clauses.  In a method that handles exceptions, by for example wrapping and rethrowing, it is important to catch the root-most “Exception” class and this post explains why even though … Continue reading

Posted in Coding, Design, Poor Error Msg | Tagged , , , , , , | Leave a comment

Handling Dates

In a globally distributed system, there are some key patterns for handling dates so that they work reliably, performantly, and are unlikely to be misused by developers.  Oddly, a number of new classes were added to Java which should be … Continue reading

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

Factoring Functionality: Who Needs to Know?

There are many ways you can break the functionality of a program into blocks that are manageable: some right, some wrong.  This post promotes a simple principle.  The primary way should be around “who needs to know.”

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

XML vs. JSON vs. YML

Here is a side by side comparison of the same data presented in three common formats.  How do they compare?  What are they good for?

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

Safe API Upgrade

First consideration for any Application Programming Interface (API) is how it will evolve in the future.  This critical interface must stand the test of time, and should whenever possible be both upgrade and downgrade compatible. 

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