RSS

Tag Archives: Java

Don’t Baby Your Builds

In a conversation this week, one developer insisted that a special build machine should be built to assure that the build is always comes out the same.  My response: if your project is building differently on different machines, then you have a much deeper problem. Read the rest of this entry »

Advertisements
 
Leave a comment

Posted by on March 5, 2016 in Coding, practice

 

Tags: , , , ,

HttpServletRequest Path Decoding

The documentation on HttpServletRequest is very poor, and this fills in a critical set of facts that you need to know to write a TomCat application. Read the rest of this entry »

 
Leave a comment

Posted by on February 23, 2016 in Coding

 

Tags:

Don’t Fear the Lowly Static Method

When people first learn object oriented programming (is there any other way) they seem to want to abandon all non-member methods (such as static methods) as being anti-object-oriented. This is foolish. There are times for objects, and times for static methods. Read the rest of this entry »

 
Leave a comment

Posted by on October 29, 2015 in Coding, Design

 

Tags: , ,

Never Use StringTokenizer

You should Never Use StringTokenizer.  That is a strong statement.  It is a bit of an exaggeration.  But in my experience, every case where StringTokenizer has been used that I have seen, has been an abuse of the original concept, and ended up in larger, more complex, and harder to maintain code. Read the rest of this entry »

 
Leave a comment

Posted by on February 8, 2014 in Coding

 

Tags:

Public or Private Member Variables?

When is it OK to make member variables public? Read the rest of this entry »

 
Leave a comment

Posted by on February 7, 2014 in Coding

 

Tags: , , ,

Method Exception Signature

In short, all interface methods, if they throw anything, should be declared to throw ‘java.lang.Exception’ and never a specialized exception class.  Find this surprising? then please read on.  The original goal to allow methods to declare the type of exceptions they might throw was a valiant attempt to clarify program behavior, but unfortunately it was misguided, does not work, and if used incorrectly can turn into a maintenance nightmare. Read the rest of this entry »

 
3 Comments

Posted by on April 4, 2013 in Coding, Design

 

Tags: , , , , , ,

File Path Manipulation

Three guidelines that make sense when handling files and paths.

  • Never Use Backslash in File Paths
  • Don’t use File.pathSeparator
  • Converting slashes from the user

Read the rest of this entry »

 
Leave a comment

Posted by on February 23, 2013 in Coding

 

Tags: