> what does this buy us?

What does it cost us?

For me the method notation is an _alternative_ not an obligation (TIMTOWTDI).

YMMV and I'm not radical about it.

I don't wanna repeat all given arguments in details, so just telegram style:

I agree that upper $foo is easier than $foo->$upper but I personally prefer

$personal{Berlin}{employee}[9]{name}->$upper to see that the name is uppercased.

and better $personal{Berlin}{employee}->length() than scalar @{ $personal{Berlin}{employee} }

Cheers Rolf

( addicted to the Perl Programming Language)

update

> reads like a sentence in English,

After some meditation, I realize that many exceptions to "reads naturally" rule in Perl are just ignored, which cause a logical break.

For instance nobody says

"rewrite from personal in Berlin which is employee of Number 9 the name".

rewrite( $personal{Berlin}{employee}[9]{name} )

You rather say "rewrite the name of the 9th employee in the Berlin catalog of employees"

The problem is that nested data structures are top-down, but we can't code

rewrite {name}<-[9]<-{employee}<-{Berlin}<-$personal

(well we could, but how likely is that to be implemented?)

OTOH human language is flexible enough to use a passive voice construct

"From the catalog of Berlin the employee number 9's name has to be (or is) rewritten."

$personal{Berlin}{employee}[9]{name}->rewrite()

I hope you get the point, with deeply nested top-down data structures a method call helps to put the verb near the subject.

Just read methods as passive constructs.


In reply to Re^2: Autoboxing ... "Yes We Can" ( or how I learned to love TIMTOWTDI ;) (passive voice) by LanX
in thread Autoboxing ... "Yes We Can" ( or how I learned to love TIMTOWTDI ;) by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.