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
|