Re: comments suck [Was: game programming meeting]
From: Christer Ericson (christer_ericson_at_NOTplayTHISstationBIT.sony.com)
Date: 07/23/04
- Next message: Christer Ericson: "Re: comments suck [Was: game programming meeting]"
- Previous message: Eric: "Re: The Decline of C/C++, the rise of X"
- In reply to: Arthur J. O'Dwyer: "Re: comments suck [Was: game programming meeting]"
- Next in thread: Malcolm: "Re: game programming meeting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jul 2004 06:11:42 GMT
In article <Pine.LNX.4.58-035.0407221143450.3510@unix50.andrew.cmu.edu>,
ajo@nospam.andrew.cmu.edu says...
> [...]
> So it's a way to produce the intersection of lines AB and CD,
> except that it returns failure under some circumstances that still
> aren't too clear to me.
Almost correct. It produces the intersection of the line _segments_
AB and CD. The failures you're talking about correspond to when
the intersection between the supporting (infinite) lines of the
segments intersect outside the segment boundaries.
> Now that /that's/ established, I think we might be able to write
> a clearer version of the code, although (getting back to the original
> topic) I think Christer is almost certainly right that we couldn't
> make /this particular algorithm/ much clearer, without actual
> comment text.
Some time ago, on a mailing list, someone made the same stupid
comment about comments as Phlip did. I posted the same code as
I posted here as an example of something requiring comments.
Someone on the list suggested that naming the inputs a, b, c,
and d, was bad, and that they would have been better named
segment1.start, segment1.end, segment2.start, and segment2.end.
Of course, the same person failed to see that a, b, c, d play
the role of _both_ segment endpoints as well as triangle vertices.
Thus, arguably, his suggestion would in fact be worse, since it
is misleading.
Anyway, if people have problems understanding this small circa
10 line program, it should be absolutely _obvious_ to anyone
with half a brain cell that comments do not "suck", but rather
that they are _vital_ to real-world code. I will leave the
corollary about Phlip's neural count unspoken, but kids,
just say no to XP, or you'll end up like him.
Christer Ericson
Sony Computer Entertainment, Santa Monica
- Next message: Christer Ericson: "Re: comments suck [Was: game programming meeting]"
- Previous message: Eric: "Re: The Decline of C/C++, the rise of X"
- In reply to: Arthur J. O'Dwyer: "Re: comments suck [Was: game programming meeting]"
- Next in thread: Malcolm: "Re: game programming meeting"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|