As mentioned, some spare time at the moment is being spent investigating the mistakes other people make using the W3C DOM API. Having now looked at literally hundreds of separate bugs, I’ve begun to construct a coarse categorization for each. I don’t claim there’s anything novel here - in fact, most of us have these internal categories well defined. All I’m doing here is spitting out a semi-minimal collection of them, and giving each a title.
Some types of errors can be argued to fall into multiple groups - this is no bad thing. The idea, eventually, is to speak of how effective certain techniques are at preventing certain types of error.
Errors of ignorance
When you don’t know what you’re doing
A remarkable amount of bugs just boil down to raw incompetence. Harsh words, but in reality, we’ve all been there. Using languages and frameworks before we’ve actually performed some experiments, being thrown into fixing a problem in a system we’ve never seen before, being forced to render comment on a project before we’ve even seen a spec - all old stories for even the most talented developers. Errors of ignorance capture the problems you introduce in this state - using the wrong constructs, not knowing what frameworks actually do, and generalised language idiom failures.
Errors of expectation
When the outside world intrudes.
Most of the time, we’re dealing in some form with input in our programs. If we expect input in a certain format, and receive it in another, this is our fault - we need to be more robust. We might also think we’ll get input in a given format, but it’s subtly different.
We can also have expectations on what other people will provide for us, or the side effects they will have on the world. Any problems induced by our expectations differing from reality, I’m currently calling “Errors of expectation”.
Errors of omission
When you forget to handle something
Often, we know what we’re doing, we intend to do it, and then just forget - perhaps to handle an edge case, perhaps to release a resource. Our natural forgetfulness leads us into “Errors of omission”.
NB: This is currently my least favorite category, which I hope to kill off, but some bugs just fall into this group very naturally.
Errors of intention
When you just got it wrong.
These are what most people would call bugs - when the we, the programmer or designer, just get it wrong. Perhaps we thought the algorithm worked when it didn’t, perhaps our mathematics is just wrong, perhaps our expectations are mutually inconsistent. The code is doing exactly what we wanted - it is, in it’s way, flawless work. It just doesn’t do the right thing because, even having missed all the above classes of errors, we still didn’t know what the right thing was - we’ve committed an “Error of intention”.
This is my first attempt at a concise set of names to concepts I’ve been dealing with for years - it will be interesting to see how they evolve as I try and put it to use.