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;)
If you check for illegal values, don't hesitate to throw IllegalArgumentExceptions to notify the caller that he made an error. You can hide the boundary/illegal value checking in private methods, that increases the readability of the code, like - just taking one of your examples:

```
private URL extractUrl(Element element) throws Exception {

  validateExactUrlParameter(element);

  // the real url extraction code

}

private static validateExactUrlParameter(Element element) 
                              throws IllegalArgumentException {

  if (null == element) {
    throw new IllegalArgumentException("Null value not allowed for exactUrl method");
  }

  // do some more checks here, if required

}

```

If you want to avoid try/catch blocks, then consider throwing unchecked exceptions (RuntimeException or custom subclasses).