"connect" naming

On Mon, May 23, 2011 at 2:58 PM, Chris Rogers <crogers@google.com> wrote:

> Think of it this way, it's like plugging a cable into a plug.  For example
> if a guitarist plugs a guitar into a guitar amplifier it would be like this:
> guitar.connect(amplifier);
> Of course, in this case, the guitar is the source of audio.
> If there's a distortion pedal in between the guitar and amplifier, then it
> would be:
> guitar.connect(distortionBox);
> distortionBox.connect(amplifier);
> So, it reads left to right as source connects (to) destination.

That makes sense *if* you know that the source is on the left and the
destination is on the right --- but a casual reader isn't going to know
that. There are lots of APIs on the Web and elsewhere that use patterns like
"stream.write(data)" where the source is on the right and the destination is
on the left ... in fact having the data flow from right to left is probably
dominant for OO APIs because "write", "send" etc are are methods on the
destination object.

"Now the Bereans were of more noble character than the Thessalonians, for
they received the message with great eagerness and examined the Scriptures
every day to see if what Paul said was true." [Acts 17:11]

Received on Monday, 23 May 2011 10:57:47 UTC