Assertions
Are you using them?
I only found out about them recently -- they've been available since JDK 1.4. I think they're vastly underutilized.... But they can be really helpful in debugging situations and don't incur any performance hit.
You can enable them in your JDK by adding "-enableassertions" to default VM arguments (type "jre" in filters in Eclipse and edit it there).
Then in your code, whenever you have a feeling "this can never be null or false" add the assertion, as in
assert thisField != null; and you're done.
Assertions are a great debugging tool.
Comments
Go to:
« previous entry: Software Engineer: Best Job in America
» next entry:
My Job Went To India
The Pragmatic Craftsman