I'm replying here at IlyaM's request (we've had a /msg discussion going for a while). I think the charge of lack of modularity in Java is way off the mark, and he thought I should put my thoughts into a post.

Extending the functionality of Java is as simple as getting the relevant .jar file and putting it on your application's classpath. If you want to make certain functionality available to all your applications (à la default @INC in Perl) you can have that, too, by putting the relevant jars in the system's extension directory, although the mechanism doesn't lay out directories à la @INC. In the most recent versions of the JDK, you can even override some of the packages in the java.* and javax.* hierarchies simply by putting jars in the appropriate directory. And, of course, you can set your classpath and other system properties however you want when you execute java, so all this stuff is flexible.

Combined with Java's (mostly) OO roots (AOL keyword: "code reuse"), in particular the ability to define interface classes and different implementations thereof, this makes for mad modularity and upgradeability, even extending in some cases to classes in the core of the language. I'm not saying that Perl doesn't have these features (you can fake the ones that aren't there by default), but that to say Java doesn't have them is based on a serious misconception.

My earlier comment merely referred to the fact that JDK 1.4 implements the JAXP specification ( standardized API for XML processing ) "out of the box", but you had that with earlier versions of the JDK simply by downloading the relevant jars and placing them on your classpath1. Java is, and has since the introduction of jars, been highly modular and upgradeable, outside of the core classes. There is still no CPAN equivalent.

1 JDK 1.4 also makes regexps available out of the box. Wow, it only took about 6 years after Perl5 =)

If not P, what? Q maybe?
"Sidney Morgenbesser"


In reply to Re: Re: Re: Re: Re: Re: How would you fix Java? by arturo
in thread How would you fix Java? by Anonymous Monk

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.