Question: I am getting a very strange client side javascript error when using asp.net ajax tool kit.

I am using user controls with a timer inside of an update panel to make call backs to the server
the error is Type Sys.UI.\_Timer has already been registered

I can't recreate the issue at all when debugging the site localy or if the site is published on my machine, The error only happens when the site is published to our QA machine and only happens in IE and only happens on 2 out of the 6 machines we have used to access it.

Answer: 
Yes, they're absolutely annoying. A few small things I've found that at least minimize this:

* Clearly document in internal api's functions that can't return null, or under what conditions you can expect null. If you can trust your documentation, at least, this allows you to avoid null checks in certain places.
* Some idioms minimize null checks - e.g. 

if (string!=null && string.equals("A") --> if ("A".equals(string))
* eclipse (as well as findbugs, I think, and probably many other ide's) can be set to flag redundant null checks, or missing null checks. Not perfect, but it helps.

But overall, you're correct. If my code didn't have null checks and logging statements, there wouldn't be anything there at all;)
At the public boundary of your component, you're always going to have to do data validation.

For internal methods, `assert`ing that the values passed are correct is better.

Returning null is something that it's better to avoid if you can. Either fail then and there to indicate that there is an error upstream of you (internal case) or return an empty or default object if there is such a thing available (public case).