in reply to Re: Some Insights from a Traveler Between Languages
in thread Some Insights from a Traveler Between Languages

For instance, the length() function operates on a scalar and is documented that way. The documentation is very clear on that. It doesn't matter to me what I think it should do as long as I know what it does do. You're just substituting one form of memory work for another. To maintain python, you have to remember type information: to maintain Perl, you need to embed the counter-intuitive behaviour of length() in your mind, in what purports to be a DWIM language. Both are awkward bits of memory work, in my mind.
  • Comment on Re^2: Some Insights from a Traveler Between Languages

Replies are listed 'Best First'.
Re^3: Some Insights from a Traveler Between Languages
by brian_d_foy (Abbot) on Apr 25, 2005 at 23:16 UTC

    "Counter-intuitive" is a relative term. I've never had a problem with length because I'm not the type to guess at what things do, and if I do guess and get it wrong, I just read the docs. I've never wondered about the "length" of an array because "length" doesn't mean "count" to me. I don't say "what's the length of that bunch of bananas?", just like I don't say "what's the count of this hiking trail?".

    You may think some things are odd, but that doesn't objectively make them odd. Instead of intuiting things, you can usually save the hassle of being wrong by reading the docs.

    --
    brian d foy <brian@stonehenge.com>