Australian Scientists Discover 'Oldest Living Thing On Earth' 172
from the sorry-dad's-television dept.
Yes, I completely agree, of course. Having "17" in the code requires some explanation.
In this case, I'd probably have something like:
enum { OBJECT_INFO_SIZE = 17 };
(my assumption here is that I need to skip a certain size in bytes in some byte stream that needs to be parsed - of course if sizeof(struct objectInfo) works then that's even better).
But even so, someone might say "I understand that you are skipping objectInfo, but *why*?" where a comment could really help:
offset += OBJECT_INFO_SIZE;
Well, I've also seen comments like this:
byteCount -= 17;
But the comment can become useful if you only change it slightly:
offset += 17;
Then you don't have to search in the code where objectInfo is stored - it's clear that it isn't.
Sometimes I find myself reading the code, explaining it to someone, and then I say "actually, that's exactly what the comment is saying..."
There's also a risk that someone would introduce a bug while keeping the documentation correct. So what? We live in a dangerous world.
Comments can be useful, and there is no need to avoid them just because they could be wrong. If the code is wrong, you need to know what it's supposed to do (and why) before you can decide that it's wrong. That's where comments can make your life easier.
I'm always annoyed when I watch a film, find it boring / stupid, and then get told by fans that the film doesn't make sense unless I read the book first. If I wanted to read the book, I would have read the book, but I actually wanted to watch a film. If the director can't do his job, that's not my problem (even though I get to pay for the ticket, the popcorn, and the time).
But then I realise that most of the films-from-books I've watched, having read the books first, were over-simplified, shortened, shallow versions of the book, and would probably be boring / stupid / full of obscure references that wouldn't make sense to anyone who hasn't read the book first.
The fact is, it's a huge challenge to convert thought provoking prose which takes you days or weeks to read into 2 hours of action. Even films that are based on short, simple stories have serious issues in most cases. That is, unless the books themselves are nothing but action and read like a script...
I heard that lioness milk is the stuff, but vegans seem to disagree.
Must be the goodness of their hearts then.
No, I have no excuse this time, just blindness and stupidity...
Never mind, better luck next time guessing the obvious
Reminds you of the usual Christmas questions on Slashdot: "This year I've decided to give my family a Linux distro on a USB stick. Any suggestions?"
I didn't get the impression that he was saying "everybody's buying other people stuff that they secretly want".
He only said "don't buy other people stuff they have no interest in, just because you do".
How do I know the write is a "he"? Educated guess.
It's no longer a question of staying healthy. It's a question of finding a sickness you like. -- Jackie Mason