Null references (oh no, not again!)

Walter Bright newshound1 at digitalmars.com
Wed Mar 4 10:40:43 PST 2009


Sean Kelly wrote:
> In a language like Java where basically every variable is a reference, 
> it can be a lot more difficult to figure out where a null came from. 
> I've never had this problem in code I've written either, but I've had to 
> maintain some Java code that was nearly impenetrable and this was 
> absolutely an issue.

I've found that variables are rarely written to, but often read. A grep 
finds the handful of places where it is written to (a good IDE should 
also provide this information much better than grep). There just won't 
be that many places to look.

(I tend to use grep a lot on code, and so tend to write variable names 
that are amenable to grep. If you use globals named "i", hope you have a 
decent IDE!)



More information about the Digitalmars-d mailing list