I've been writing OO code for about 6 years now (first C++, then Java, then some Python and Perl), and Python and Ruby turn me off. True, Perl's OO implementation is scarred and awkward (awk-ward? sorry for the pun), but the underlying tenets of Python (tabbed identation, "there is only one way to do it" (TIOOWTDI)) and Ruby (well, it's like Perl, but it doesn't have as many cool toys) hardly make them languages where you can truly feel at home. Java is well liked by those that like it, but you will find it is also disliked by the greatest of OO purists, and while it tried to 'fix' OO in C++, it made a few issues of it's own.

Perl, while it requires more discipline to make OO work well, really is a breath of fresh air, since it is unencumbered. However, you really do have to watch yourself carefully. Perl6 will fix much, and I am looking forward to it. But I have been long polluted by the evils of Lisp, a language where it is hard to get many things done, but once tasting the waters, you start to code Lispy things in other languages.

Yes, if you are new to OO, I don't recommend learning Perl OO first...but once you know it, Perl is definitely workable there (and the mixture of OO and functional concepts, to me at least, is the holy grail). Maybe you could learn it first, but be careful, and be sure to pick up a few others along the way to balance yourself as you dive into the depths of Perl modules.

One of the more seductive things about OO, especially in other languages, is the tendancy to overdue objects and limit the usage of constructs found in the core language. Java is the extreme for this, and in some cases it works, but in Perl, you have the feeling you can use as little or as much OO as you want. Also, being Perl can be a little heretical to the buzzword-compliance trends in OO these days, you feel less restrained and you have more fun. Perl culture, for instance, doesn't require overabundance of getter and setter methods as Java seems to -- which is good, because that is a misleading practice to begin with.

Anyhow, OO is loosely defined and is largely what you make of it. It's always subject to debate. To use pure objects? To mix paradigms? Where to go? Learn from others -- both from what they get right, and what they get wrong. There really isn't a true path to OO design, find what works, and don't stop evolving as a developer. I once was a huge hardcore "OO only" guy coming out of college. Industry has taught me a lot about balance and when to say no to excessive object proliferation -- but everybody looks on OO design differently.


In reply to Re: Re: I heart OO by flyingmoose
in thread I heart OO by stonecolddevin

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.