jacques has asked for the wisdom of the Perl Monks concerning the following question:

I've decided to go back to school and my first class will be an introduction to Java. I haven't played with Java too much and I am wondering if there is documentation out there introducing Java to Perl programmers. In the traditional Perl books, Perl and C/C++ are sometimes compared, but barely any Java mentioned. Does Conway's OOP book discuss Java at length? Has anyone ever compared the languages at a conference? I am looking for more than just a few hints and comparisons . . .

Replies are listed 'Best First'.
Re: Java for Perl programmers
by hardburn (Abbot) on May 07, 2003 at 16:18 UTC

    Java's OO is generally cleaner than Perl's, at least from the point of view of the language itself (the API, OTOH, has turned into an unmaintainable mess of broken classes that were replaced with brand new classes instead of fixing the orginal problem). Inheirtience, in particular, works a lot better (inheritience is so clunky in Perl5 that some people say you should avoid it completely).

    As for overall language comparisons, it's hard to find objective comparisons between Perl and Java, but you can dig up plenty of flame wars.

    IMHO: When I was first learning Java, I thought I had finally found the closest thing to the One True Language I could ever hope for. And indeed, the language structure and object system is very clean. However, the API is so annoying that it elimnates any benifit the underlieing language would have given you. And don't get me started on AWT and Swing.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Re: Java for Perl programmers
by tall_man (Parson) on May 07, 2003 at 16:18 UTC
    There is a section in Conway's book, pp. 449-454, that compares object-oriented Perl and Java. Not long, but pretty good.
Re: Java for Perl programmers
by abhishes (Friar) on May 07, 2003 at 16:31 UTC
    Hello Jacques,

    In my opinion, When you pick up a new technology like Java (or .net) you should learn it in its own right ... Trying to find Java's weakness against against Perl will only create a mind block for you ... which can hinder your motivation in learning it. (Which can result in poor grades at school)

    I have been to some conferences which compared languages or platforms... but they were completly useless and full or marketting talk.

    So just pick up a good book and learn Java. After you have gained some experience and proficiency in the language. The strength and weakness will automatically be visible to you.

    Hope this helps.

    regards,
    Abhishek.
Re: Java for Perl programmers
by iguanodon (Priest) on May 07, 2003 at 16:58 UTC
Re: Java for Perl programmers
by edoc (Chaplain) on May 07, 2003 at 16:22 UTC

    Conway's book has about 4 pages directly comparing Java & Perl. He does a short stint on each of Objects, Classes, Methods, Constructors and finalizers, Encapsulation, Inheritance, Polymorphism, and Exception Handling. There's then a page ana bit table of comparative syntax.

    not sure if it's worth buying the book just for that, but since the rest of the book stands up on it's own, it'd be a bargain! 8)

    cheers,

    J

Re: Java for Perl programmers
by TStanley (Canon) on May 07, 2003 at 16:37 UTC
    jacques:

    You can also check out JavaJunkies as a resource. The activity level there isn't as high as this site, but there are quite a few monks who put some time in there.

    TStanley
    --------
Re: Java for Perl programmers
by PodMaster (Abbot) on May 07, 2003 at 16:52 UTC

      Don't forget about...

      How to STFW


      Update: How to RTFM does indeed mention Google. I just couldn't resist using STFW in context. :)

        Silly cciulla, How to RTFM mentiones google.


        MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
        I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
        ** The Third rule of perl club is a statement of fact: pod is sexy.

      No fair. That Q&A is buried under the OOP section . . . but thanks for the pointer.