After a little while away from the forums, here I''m back. Probably you won''t notice it at all .
When I code, I use to comment not using "We" nor "I" but the phrase "Simon says".
For example:
// Simon says it will load a bitmap
Or:
// Simon says I''m the hell crazy
But as lately I''m coding alone, Simon can''t tell me nothing at all (or I can''t hear him) so I''m now commenting this way:
// Simon would say it will load a bitmap
Nah, the true is that I always write code as if somebody else was going to read it. That helps me to keep it clear, and it''s always useful to write nice looking code when you are doubtful about if you will release the sources sometime.
About the "We" and "I" in the code, when I write them I mean the following:
"I": meaning what I was trying to do when coded some stuff
"We": the same, but hiding the egocentrical "I" a bit. If you ask a writer why does he write things like "Now let us explain" he''ll tell you that it''s a way to be humble while showing an opinion or action of himself.
Some time before I used to write jokes (most of them very inner and obscure ones) in the commentaries, but when it was coming to be more jokes than real code I decided to stop.
--DK
--H. Hernán Moraldo
Are many programmers mentally ill?
Perhaps there are two kinds of programmers - left brained and right brained. Lefties see programming as a creative act and tend to write code comments in first or second person. Righties see it as a mathematical exercise and write cold, objective comments.
I think it''s more likely, though, that the second person thing is a result of being taught programming by example - we learn coding from tutorials where the comments naturally use the second person.
Personally I comment my code a lot, I do so almost without thinking about it now. I tend to write a comment line, THEN write the code it relates to. This is for my own benefit (as I code, coz it gets what I''m doing clear in my mind) and it''s for the benefit of the other guys in my team who have to read, and build on the code.
Well, enough procrastinating, I''d better do some work
I think it''s more likely, though, that the second person thing is a result of being taught programming by example - we learn coding from tutorials where the comments naturally use the second person.
Personally I comment my code a lot, I do so almost without thinking about it now. I tend to write a comment line, THEN write the code it relates to. This is for my own benefit (as I code, coz it gets what I''m doing clear in my mind) and it''s for the benefit of the other guys in my team who have to read, and build on the code.
Well, enough procrastinating, I''d better do some work
The Anon poster above got it backwards. The right brain hemisphere is the ''creative'' one and the left is the ''analytical'' one.
Also, "I" and "We" are first person pronouns (singular and plural respectively), not second person. Second person pronouns would be "you" and "you" (singular and plural are the same).
Also, "I" and "We" are first person pronouns (singular and plural respectively), not second person. Second person pronouns would be "you" and "you" (singular and plural are the same).
Hey, I just comment the code how the voices in my head tell me to.
"There is humor in everything depending on which prespective you look from."
"There is humor in everything depending on which prespective you look from."
Me, I rarely (if ever) comment my code, for two very good reasons:
1) My self-imposed Doctrine (see my signature), and
2) I usually work alone, and I have a knack for reaading code...most of the time, anyway
When I do comment, though, I do it only in two situations: when I''m using some dumbass shortcut to speed things up (bit shifts instead of math and crap like that), in which case I use the cold, impersonal comment to clarify what I did:
// same as multiplying nWidth by nFactor
Or, if there''s a big chunk of code that''s genuinely confusing - especially hacks and kludges - I''ll comment in full sentences and whatever the hell perspective I choose:
// This _should_ set everything up properly, but I''m not
// sure - better check for kludge-ness ASAP.
I never, ever use we, or us, though... not since the accident... *peers around the room*
-Normie
I am a devout follower of the
"Lazy Programmer''s Doctrime"(tm)...
and I''m damned proud of it, too!
-----
"I came, I saw, I started making
games." ... If you''ll excuse
me, I must resume my search
for my long lost lobotomy stitches.
1) My self-imposed Doctrine (see my signature), and
2) I usually work alone, and I have a knack for reaading code...most of the time, anyway
When I do comment, though, I do it only in two situations: when I''m using some dumbass shortcut to speed things up (bit shifts instead of math and crap like that), in which case I use the cold, impersonal comment to clarify what I did:
// same as multiplying nWidth by nFactor
Or, if there''s a big chunk of code that''s genuinely confusing - especially hacks and kludges - I''ll comment in full sentences and whatever the hell perspective I choose:
// This _should_ set everything up properly, but I''m not
// sure - better check for kludge-ness ASAP.
I never, ever use we, or us, though... not since the accident... *peers around the room*
-Normie
I am a devout follower of the
"Lazy Programmer''s Doctrime"(tm)...
and I''m damned proud of it, too!
-----
"I came, I saw, I started making
games." ... If you''ll excuse
me, I must resume my search
for my long lost lobotomy stitches.
If you happen to have a partner working with you when inserting comments on code, watch them carefully.
I once inserted this little bit into a piece of code:
//Load the bmp, Please Hal.
The next day I''m looking through my commentary, and I found this in the same spot:
//F*** you, Dave. I''m the one in charge now.
//But I''m lying so it doesn''t matter.
I once inserted this little bit into a piece of code:
//Load the bmp, Please Hal.
The next day I''m looking through my commentary, and I found this in the same spot:
//F*** you, Dave. I''m the one in charge now.
//But I''m lying so it doesn''t matter.
When I use first person plural in my comments, I''m referring to "me and my computer".
The computer''s doing, but I''m telling, so we share a sort of joint responsibility for what happens. Is this insane?
If so, I don''t think I''m alone.
The computer''s doing, but I''m telling, so we share a sort of joint responsibility for what happens. Is this insane?
If so, I don''t think I''m alone.
I only post short comments as:
And then I have many //checks this & that
But I often write it in my own dialect(a swedish one)
/MindWipe
"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."
//Tile animation//Should never come to this point//If go under the playfield - Player should die
And then I have many //checks this & that
But I often write it in my own dialect(a swedish one)
/MindWipe
"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement