> No. I consider list_active_employees(\@employees); readable enough.

and your polluting your namespaces...

No your not only polluting main:: you have to pollute every package/class which makes use @employees, or you have always to write Employees::list_active(\@employees) or import from Employees!

And additionally you have to build parameter checking to avoid calling list_active_employees with the wrong object.

... but if something was designed and used for a long time as a plain, transparent data structure, then all the code accesses it as such. And does things you would not want code to do with the insides of an object. ...

You're still thinking within the chains of the old functions. If you used everything from the beginning as an object, you'll have no problems to protect the inside afterwards.

That's why I started using Tie in "Phase 2".

Anyway you might get me wrong, I'm not opposed against writing push @$arr,"elem" as long as it's clear that it's nothing else than $arr->push("elem"), so I can have the best of both worlds and stay backwards compatible.

Other languages do this and actually that's already more or less the mechanism behind tie.

Just the interface in Perl is really messy, confusing and obfuscating the code...

Cheers Rolf


In reply to Re^4: Benefits of everything is an object? Or new sigils? by LanX
in thread Benefits of everything is an object? Or new sigils? 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.