I've also noticed that there's a fine line between ATD's (Abstract Data Types) and Classes. A class is a way to create your own ATD's, though all languages have built-in ATD's.

I also note that the Perl scalar, unlike a C primitive type, is polymorphic. A function can do different things depending on its actual content at run-time, which could be a string, float, int, hash, or undef.

Scalars can also be tied. So you are indeed calling FETCH as an abstract interface, which could have any of a number of implementations behind it, including the built-in normal one.

As for your 4th paragraph, you make a case that any "higher level" language indeed treats variables and values as objects. However, simple languages like old BASIC don't provide for OO programming because you don't create your own object types as a means to solve a problem. That's a crutial difference—a few built-in objects as part of the language definition doesn't allow you to take an OO approach in programming.

—John


In reply to Re: Why perl is more OO than C++ or Java... by John M. Dlugosz
in thread Why perl is more OO than C++ or Java... by dragonchild

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.