get and set methods are evil.

There is some truth to this. I am not familiar with the article so I don't know Holub's perspective. (Update: I have read articles by Holub in the same vein.)

The idea that an attribute should be indistinguishable, at the interface level, from equivalent fetch and set methods is extremely convenient in a language.

class SAMPLE is data:INT is return something; end; data( param:SOMETYPE) is do_something( param) end; end
is the same as
class SAMPLE is attr data:INT; end
To not use set and fetch methods is problematic in languages that do not have this feature when the interface of a class may change. Many languages require invasion of clients to change an attribute to a method. Programmers choose methods in defence against change.

I suspect that Holub's complaint is that a lot of fetch and set methods are either being added thoughtlessly or show a poor object design abstraction. In some languages preserving a flexible interface is a strong counter-argument to the former. I agree with the latter but know there are exceptions, e.g. users wanting to "emulate" a paper trail.


In reply to Re: Re: (OT) OOUI: multiple views in an object. by rir
in thread (OT) OOUI: multiple views in an object. by BUU

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.