Scripting languages again

[prev] [thread] [next] [lurker] [Date index for 2003/09/16]

From: dagbrown (Dave Brown)
Subject: Scripting languages again
Date: 22:21 on 16 Sep 2003
Class, can I have your attention?

Hands up, everyone who knows how to find the length of a string in
Perl.  Yes, Jimmy?  You're right, the answer is "length()".

How about C++'s string class?  You're right, Elizabeth, it is
"length()"!

Anyone want to venture how you get the length of a string in Ruby?
Oh, hello, Simon!  Yes, the answer is "the length() method!".
Very good!  Yes, thank you, Simon, I know that you can also use
"size()".  That's enough.  THANK YOU.  Alright.

Can anyone in the class explain why Python chose to have "return
the length of a string" be a standalone function called "len()"
forcing the would-be Python programmer to reach for the manual?
Nobody?  Ah, young Guido, yes.  "Because that would be too much
like Perl, which is unreadable by definition."  That's certainly
an interesting theory you have there.  I'll be sure to share it
with the rest of the teachers after class.

Feh.

--Dave
-- 
  "Not Dave!  It must have been somebody evil forging a post from him.  I don't
believe Dave is even capable of threatening, abusive or insulting language."
  "And so say all of us!"
                                        -- Chris Reuter and Matthew Skala

Generated at 14:02 on 01 Jul 2004 by mariachi 0.52