Because encapsulation helps prevent action at a distance, structured naming helps prevent typos

And here I go on an irrelevant-to-OP tirade again, sorry.

Is Perl's business to prevent action at a distance and typos? Educate, supervise, mentor and pay a developer more and they will be more careful. Then, code reviews can reveal practices which are considered "bad" by management (i.e. action at a distance).

IMO encapsulation means encapsulation of the program logic. Creating a black box which goes out and hunt. Encapsulation, for me, does not mean protecting each and every variable in there from sloppy devs, although I am sure there will be countless "software" "engineering" "books" out there promoting this hysteria. Hey, why don't we enclose each Object within a firewall for good measure? That's the nanny-state of programming.

But that's exactly what it came to mean today. It's this industry alone which promoted all those sloppy devs or rather the sloppy dev processes and "key-hole programming". The current meaning of the word encapsulation brings to my mind all those phone chargers which have been encapsulated in raisin so hard one can not remove a single piece of copper from them or fix them. For safety, they claimed. But in the 3rd-world's dump heaps which inevitably said chargers end up they are "de-capsulated" really well in true Gordian fashion: burn the plastic and melt them in acid, which kills them poors and the planet too.

Personally, I don't want to see Perl "polluted" by new keywords and new syntax. Aesthetically, at least, I am not comfortable with the "has" and friends. So I only use the minimalist (classic) OO provided by core Perl. KISS. But I also see the point of view of the others who do like or rather need, and use them. Fine.

Subjective, personal opinions: I consider OOP a real step forward, like Man standing on 2 feet. Judging from PM questions (a very rough indicator) OOP+Perl is used by only few. Even using packages alone to encapsulate and separate program logic is not the commonest practice. I would concentrate on making these two things much more accessible than actually alienating users by enforcing extra nomenclature like "has" (see where make-a-keyword-a-day Java ended up). I said before, albeit being ignorant about the details: those who can, perhaps could spend their effort in modernising the perlguts instead. Or offer us mortals truly accessible, simple documentation to perlguts and XS so we can be educated and participate. "has" can wait AFAIC (and so can function signatures).

I wake up each day in fear that Hashtables fall to the hands of "language revisionists" (sorry!) (re: typos of keys). That will be a slaughter.

I welcome down-voting as a means of "silent" disagreement.

bw, bliako


In reply to Re^6: oop, variable that counts the number of objects created by bliako
in thread oop, variable that counts the number of objects created by Anonymous Monk

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.