OT Signature quote [was Re: Unrecognized escape sequences in string literals]

Douglas Alan darkwater42 at gmail.com
Sun Aug 16 01:51:07 EDT 2009


On Aug 16, 1:05 am, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Sat, 15 Aug 2009 20:00:23 -0700, Douglas Alan wrote:
> > So, as far as I can tell, Python has no real authority to throw stones
> > at C++ on this little tiny particular issue.

> I think you're being a tad over-defensive.

Defensive? Personally, I prefer Python over C++ by about a factor of
100X. I just find it a bit amusing when someone claims that some
programming language has a particular fatal flaw, when their own
apparently favorite language has the very same issue in an only
slightly different form.

> the poster using it has (as far as I know) no official capacity to speak
> for "Python"

I never thought he did. I wasn't speaking literally, as I'm not under
the opinion that any programming language has any literal authority or
any literal ability to throw stones.

> Now that I understand what the semantics of cout << "Hello world" are, I
> don't have any problem with it either. It is a bit weird, "Hello world">> cout
> would probably be better, but it's hardly the strangest design in
> any programming language, and it's probably influenced by input
> redirection using < in various shells.

C++ also allows for reading from stdin like so:

   cin >> myVar;

I think the direction of the arrows probably derives from languages
like APL, which had notation something like so:

     myVar <- 3
     [] <- myVar

"<-" was really a little arrow symbol (APL didn't use ascii), and the
first line above would assign the value 3 to myVar. In the second
line, the "[]" was really a little box symbol and represented the
terminal.  Assigning to the box would cause the output to be printed
on the terminal, so the above would output "3".  If you did this:

     [] -> myVar

It would read a value into myVar from the terminal.

APL predates Unix by quite a few years.

|>ouglas



More information about the Python-list mailing list