After you have stripped the problem bare of every conceivable fancy feature, next divorce yourself from any concern that anything could go wrong. Assume you have perfect data. Assume that when you look something up in a table it will be there. Assume your references will never be null. Assume your casts will never fail. See if you can then write the code. You can then focus 100% on the normal case.
While you are doing this, scores of what-if-x-happens? thoughts may crowd your brain making it impossible to focus on the normal case. Just create a comment section labelled worries, and jot your concerns there. Later, go back and review that list. Often your code will handle those pathological conditions in the wash. Others you will have to add code to deal with. As you cover each concern, delete it from the list. The key is not to overwhelm your brain with too much detail.
By focussing on the normal case first, your code will tend to be better structured, to emphasise the usual case rather than the pathological. Someone reading your code usually first wants to understand the most common cases. I have an idea for SCIDs to make that emphasis on the usual cases even easier.
![]() |
and suggestions to improve this page to Roedy Green : | ||
| Canadian Mind Products | |||
| mindprod.com IP:[65.110.21.43] | |||
| Your face IP:[38.103.63.62] | ![]() | ||
| You are visitor number 8,329. | |||
| You can get a fresh copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) | ||
| http://mindprod.com/jgloss/tackling.html | J:\mindprod\jgloss\tackling.html | ||