Poll: What do comments mean?
-
From:
I mean really. What do they mean.
Specifically, what does this comment mean:
// Load the person
Which of the following gives the most correct interpretation of that comment?[poll]
- The following code loads the person
- The intent of the following code is that person object is loaded.
- The following code may load the person
- The following code used to load the person
- The programmer thinks the following code loads the person
- The programmer used to think the following code would load the person
- The following code almost certainly doesn't load the person
- The programmer once typed
// Load the person
at this point in the code - The programmer once copied and pasted
// Load the person
into this point in the code - Maybe, at this point in the code, a code generator once created a comment that says
// Load the person
or maybe an automatic merge went bezerk and put that comment there; maybe a programmer copied and pasted the text in, but in any case there's a slight chance that the following code may once have had some intent vaguely related to loading, or unloading, or otherwise tampering with an object, possibly of type person or people or, more likely, something else altogether. - There is a comment at this point in the code that reads
// Load the person
- COMMENT_NOT_FOUND
[/poll]
-
There is no situation in which the comment "load the person" makes sense in code. "load the person's data", sure. Or maybe, "load a description of the person". But "load the person"? No.
Oh wait. Maybe that computer in Tron with the digitizing laser. Maybe that's the answer.
(Oh, and to the idiot about to type: "well it's vague language, but you know what they mean!" that is kind of the entire point of this exercise: you don't know what they mean. You only know it can't possibly mean what it literally says.)
-
What if it's code to operate a circus cannon?
-
If the person is loaded into the cannon with a robot-arm controlled by the computer, I'll allow it.
-
"load the person's data", sure. Or maybe, "load a description of the person".
Either of which could make sense depending on the context (that we don't have). With context you can drop words and still successfully communicate.
-
What if it's @algorythmics' code?
-
In that case, the comment would read
// load the sexy person
-
What if it's @algorythmics' code?
Then it's good we don't see the function prototype. Because I'm sure I don't want to know what the person is getting loaded with.
-
Sane codebases follow option 1 or 2. TDWTF specimens follow option 7, 8, or 11.
-
honestly i've learned over the years that the only answer on that list that is guaranteed to be correct is #11. anything else is a bonus (or penalty depending on what it turns out to be)
-
We need one of these for "person"
-
The programmer is referring to himself as the person, and intends to drink heavily.
-
Would "absolutely nothing" be included under "COMMENT_NOT_FOUND"?
-
You need to look at the bigger picture:
Console.WriteLine(@" //Load the person ");
Whoops.
-
-
Who cares what the comment means? The compiler ignores it. Not important.
-
We have a KUKA robot in our factory, sadly it's too small to do this:
-
I was wondering if, during that first turn, it was going to bang his head into the floor.
-
As a matter of fact, I would say you are closest to the solution to this whole poll.
A comment on itself doesn't mean anything.
A comment like this gets its meaning from its context.Just like a single line of code usually doesn't mean anything if looked at it might becomes a meaningful contribution to a procedure when looking at the complete
consider this:
/* loads a person from the database and changes the corresponding number. @params blablabla */ void ChangeUserNumber(string user, int number){ // Load the person person User = getPersonFromDatabase(user); // actually do shit User.setNumber(number); doOtherThings(); }
There, you guys will probably tell me that this is the worst code you have ever seen and you can not see this ever being used ever because it has "// Load the person" as a comment and stuff but really now.
To further illustrate my point:
what doesCounterForFunctionCalls++;
mean?- reflects that a function has been called once more
- the programmer wanted to increase a variable
- the programmer forgot that he/she overloaded the ++ and broke the whole code
- a variable that is called CounterForFunctionCalls is increased by one
- The Programmer wanted to write a comment and failed
- The Programmer could not find the Comment
- You can't answer this question because you are lacking content
- You still don't get my point!
- Why are you still reading this?
- Are you a stalker?
- Look, an SEP-field
- I am going to stop now
- I lied
- Might as well end the post now
Filed Under: I really ended my post
-
-
@Cursorkeys said:
it's
totoo small*twitch*I have no problem with your post
FTFH and FTFYFiled Under: Double Fix! | Using Discourse idea of content-diffs
-
A comment in the code means the code has a comment. Everything else is (reasonable) inference.
-
Dammit. I've been trying extra hard since Bort first pointed out one of those.
It's now making me paranoid about my work emails.
-
"it's vs its" trips me up. I know how to do it right, I still do it wrong w/o seeing it.
-
Remember my rule of thumb: use the opposite of what you'd do with any other word.
-
could be worse. I once misspelled the word
it
with an extra t such that spellcheck did not catch the error.This was in an email to most of the IT staff including Boss, Boss+1, Boss+2, and CTO
...... whoops.
of course the most embarassing part of that was who commented on the spelling error first..... the CTO.
Interestingly followed shortly by an appology attached to a forwarded note from HR. Not sure who told HR about that email, I didn't and no one mentioned the spelling error or the comment again, ever.
-
could be worse. [example]
Another rule of thumb is re-read the damn thing before you hit send, so that doesn't happen. Because it WILL.
-
G is very close to T on a keyboard. This is why I don't sign off emails with "Kind Regards"
-
Another rule of thumb is re-read the damn thing before you hit send, so that doesn't happen. Because it WILL.
did reread, always do when the email could go higher than boss. didn't reread carefully enough, do better now.
-
"it's vs its" trips me up. I know how to do it right, I still do it wrong w/o seeing it.
Use a different pronoun and it is more obvious: "it's" means "it is". Using a different pronoun: "who's [there]". You wouldn't write "whos there", right?
The 's is a contraction of is and therefore is not attached directly to the word."its" means "the [whatever] from it". The -s is a genitive, it's a suffix attached directly to the word.
I don't know what your native language is, but you might have something similar.
Filed under: I'm not a native English speaker/writer, pendants are welcome to amend my explanation
-
Using a different pronoun sounds harder than just seeing if it can be written in unabbreviated form, but what do I know?
-
Using a different pronoun sounds harder than just seeing if it can be written in unabbreviated form, but what do I know?
Expanding it's to it is works, but if you expand its to the [whatever] of it, your sentence sounds unnatural.
Of course, if you do it in your head just to see whether the abbreviation should be it's or its, that's not an issue.
-
No, I meant that if you can expand to "it is", then it is "it's". Otherwise it's "its".
-
No, I meant that if you can expand to "it is", then it is "it's". Otherwise it's "its".
Ah, I see. I wooshed on that the first time.
-
Of course, if you do it in your head just to see whether the abbreviation should be it's or its, that's not an issue.
Once again, use my rule of thumb: Would any other word take an apostrophe here? Answer that, then do the opposite.
-
@Frostcat's wrong to say that
It's wrong to say that