Howdy!

I have just recently been subjected to Java training, so now I am officially dangerous (got the certificate and all that).

I actually behaved myself in class, being a Perl programmer at heart. It was interesting (for several values of "interesting") to compare and contrast Java and Perl (and C, on the side). On top of that, I have a body of C code written ten years ago that I have inherited. That code was written in a visibly object oriented manner, to an extent.

I can see benefits to the enforced "everything is an object" view of Java, but the designers stopped short by allowing the "primitive" data types to be non-objects by default. Sure, you can wrap them in an object, but you then have to cast this and access that to do real work with them. The benefits would be greater (IMO) if the so-called primitive data types were just as object oriented. Sometimes you get too wrapped around the axle figuring out just which flavor of object to use...

I do appreciate the freedom in Perl to use as much bondage and discipline as I want, but to stop when it is "enough" (and the definition of "enough" is right rubbery!). I have not yet sat down and written "Java::MethodMaker" to autogenerate stub class files with all those pesky getter and setter methods written...

Now, one thing I see in common between Perl and Java is an apparent reduction in the amount of gratuitous (but necessary) code I have to write. Java exceptions let me elide all that cluttery error checking code (at the cost of having to make sure I set up my exception classes appropriately). Perl's expressive power lets me say a lot of things with less code, and things like database programming involve so much less necessary but obstructive support code to set up queries and bind variables to columns and all that cruft.

On the Java side, I'm trying out NetBeans as an IDE. I'm not entirely thrilled with it, but it seems somewhat useful. My "IDE" for Perl is nedit or BBEdit, depending on the system I am running on. The Perl "IDE"s don't offer quite the level of language specific tools, but I'm not sure that is a real minus (and may even be a plus for versatility).

As I ramble, it just occurred to me...

In Java, one is faced with a gazillion standard classes to do all sorts of things. Which Collection type do you want to use for this set of stuff? Have fun picking through the list of choices! On the other hand, you have no real control over the object system. Perl, on the other hand, gives you lots-o-options for how you implement your objects, but you don't have the "thirty gazillion ways to do hashes and arrays". OK, I generalize heavily here, but this is more of a "how the lay of the land looks in my mind" than a precise technical assessment. Sort of how my mental map has me living in a "suburb of DC" and "far from Annapolis", when, in fact, those two locations are essentially equidistant from me, and accessible by an Interstate grade highway. It's not rational, but I can't deny the charge.

yours,
Michael

In reply to Re: More discipline or more freedom - in the context of OO by herveus
in thread More discipline or more freedom - in the context of OO by pg

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.