Hi Mark,
Coding is a human activity, and the way humans act has to be taken into consideration.
Yes, it most certainly does. But "taking into consideration" doesn't mean that it's ok to support the development of code without
documentation. It just means that you need to take as much care in ensuring that your developers are skilled enough to write
documentation as they are skilled to write code. It's not a valid excuse just because your group of developers doesn't write
documentation that you find to be useful. It is a skill just like coding is a skill.
Actually, in TDD, the unit tests do specify the "correct" behavior, because they drive the development. You don't write code until
you have a failing test.
They specify what's assumed to be correct at the time they pass. Finding out that the code you've written is a bug later on is what
I was referring to. In other words, it's "correct" when you right it but it's intention may turn out to be wrong.
Also, I mentioned "accidental" bugs as opposed to "purposeful" ones (and I don't know of any guidance that makes this distinction
but I'd be happy to learn of two other words that are more descriptive then "accidental" and "purposeful"). The purposeful bugs are
those that you intentionally code, following specifications and addressing requirements, but then they turn out to be wrong or the
overal design was incorrect and didn't actually address the business requirements. Accidental bugs, such as type-o's and logical
error, occur when your code does not faithfully implement your intentions. I believe that documentation can help to fix both cases
of bugs by allowing the reader to follow along with the user's intentions, through there code, without having to infer them from the
code itself, which is obviously wrong - the reason you are fixing a bug. Especially useful for "accidental" bugs, which is why I
mentioned it.
Or it might be utterly misleading. The -only- thing that's guaranteed to be completely true is the code.
The code is never guaranteed to be right, however. But again you shouldn't base your entire opinion on bad experiences (or no
experiences) with documentation and assume that nobody knows how to write it. If you have that skill, it's very useful. Do you
trust the people on your team to write good code? I'd like to trust people as much as I can to write good code and appropriate
documenation, otherwise they might not be at a high enough skill level to be working on the project in the first place. Peer-review
helps to alleviate mistakes that people make, no matter how high their skill level. Documentation is even useful in peer-review,
and can be reviewed itself for accuracy much like code. It's just another aspect of development that has helped me in the past and
so I continue to use it and will continue using it into the future.
You're really fixated on the idea that you can't trust documentation. I feel that more often than that you can't trust certain
developer's code. But then again, agile guys don't write buggy code I guess
The question is whether it's better to fix those bugs or fix other bugs (like the ones the user sees). It's a question of
opportunity cost. In an ideal world, it would be great to have complete, perfect documentation. We don't live there.
I think we've been discussing whether to even write documentation in the first place or not. But if you are writing appropriate
documentation it's much easier than writing code and there is far less often bugs in documentation than code as long as time is
invested to keep it up to date. That's why I document my code (aside from in-line comments) after finalization, whenever possible,
so that code documentation is usually a one-time deal. And if you have planned your design ahead of time then you might just find
your code even easier to comment on. You can also use xml-includes to pull in repetitive comments. I feel that the cost of writing
documentation is low, especially if you can realize its usefulness to help fix bugs, change code or update legacy code at a later
time, of which the cost without documentation is usually quite high.
I think we're going in circles a bit here. We have different methodologies and guidance that we follow as developers and it
dictates how we use documentation in planning and code. I'm not sure we're ever going to agree on this.
This assumes that the documentation accurately reflects that intent. And that the intent has any relationship to the current code.
Both of which are highly suspect.
Again, if a developer writes comments on code and they have no relation, then the developer isn't doing their job. It's just that
simple. If you trust them to write code, and they have that skill, you can trust them to write documentation too if they have that
skill as well. I really think you're having trouble letting go the argument that documentation isn't useful because sometimes it's
just wrong. And I think your exaggerating its negative impact on the development lifecycle too.
Man, I wish we could agree on something! Don't you just feel like we're both just spinning our wheels?
How about we agree at least that we can do whatever works for us and both be "right". If you find that you're productive without
documenting your code, and I find it to be beneficial, then we are both doing the "right" thing. There is definately way too many
variables here to be analyzed, including a lot of things we haven't even touched on. Differences between RAD/Agile/MSF and any
other guidance out there. Actually, there are a lot of different development lifecycle methods because there are a lot of different
needs, so we really can't argue that any one is "truly" better, generally speaking, without context and actual statistics.
Thanks for the discussion so far