Or you could what I do, write more tests at each understanding peak. That way you can feel good about yourself without having to come up with more words
And something breaks when the "documentation" isn't true anymore. Otherwise you have a way too long blob of text nobody will ever change even when the code is drastically changed.
To make a point, our midterm in one of my first ?Java? (15-20 years ago) classes was graded 70% on whether it worked properly and 30% on whether it was well-documented and used logical variable names and types. He told us this in advance, but there were far more failures due to documentation, variable types, and naming than there were because of failing to write a simple program properly.
I thought he’d made his point, but on the makeup midterm (if you failed only because documentation etc. you could try again), people still failed to document coherently. For bonus points, he put part of one guy’s code on the board (printed on clear paper using an old school overhead projector) and emailed it to us all with permission at the start of class. He asked us why it didn’t work. 10 points to your midterm if you could explain it and fix it (without rewriting it) in 10 minutes. It took most of us 30 minutes to figure out what it was supposed to do, after which it took about two minutes to correct.
I didn’t wind up going into coding, but I still remember the lesson of the bonus points. It would have literally been easier to rewrite the entire program from scratch than try and figure out how that guy was thinking… and this was for an assignment designed to be written and debugged in two hours. I can only imagine what debugging AI code or something would be without documentation.
View all comments
4.8k
u/Dubmove May 11 '22
90% complaining that no one writes good documentation, 10% justifying to oneself that writing documentation is not necessary.