Having worked with both I can tell you that they are both truly
useful languages. If you have the opportunity you should get
to know them both. The main reason Java gets the vast majority
of the mindshare in my opinion is that it was designed for the
Internet and the new push in distributed computing, and it is
Object Oriented in nature which is the current defacto trend in
design methodology. Java also is very easy for C++ programmers
to pick up since it's so similiar which is another reason it is
Perl's strengths as far as I'm concerned are it's comprehensive
regular expression engine, it's string manipulation and formatting
abilities and it's brief syntax which allows you to quickly hack
something together that needed to be done yesterday. That is why
sysadmins love it so much because it lends itself so well to
"throwaway" code and ad-hoc solutions. Another benefit is the
community that has grown around this language and the vast amounts
of modules that have been designed to do anything and everything.
Perl's weaknesses in my opinion (others would argue that these
are strengths, but when applied to scalable enterprise systems they
cease to be amusing) are its less-than intuitive syntax, its
lack of typecasting, its lack of a coherent thread model
(I realize that there is a threads package but it is an add on,
and is not part of the standard source), and its lack of support for
certain object oriented semantics (such as templatized data types, true
inheritance, exception handling, enforceable data encapsulation, and abstraction for example).
Perl folks would argue that Perl has all these things but they
are not enforced...and the object model requires a lot more
overhead than Java. As a system gets more complex these things tend
to start stacking up and Perl objects become a tangled mess.
Java on the other hand is very strong in the Object Oriented
department...it supports a true Object model and has the ability
to implement inheritance, encapsulation, etc. Like Perl it has
a very strong community and lots of add on packages, many available for
free as well. It has a simple threading model, and great
facilities for internet applications (applets, which are more
powerful than CGI in my opinion, as well as servlets, etc.)
JavaBeans allow you to build reusable components that can be
dropped in as building blocks to other applications. One of the
other strengths is its distributable nature, there are a large number
of CORBA orbs with built in Java support, while I believe only MICO has
Perl support. Another issue is the fact that I find Java debugging
easier to do than Perl due to Perl's lack of typedef.
For me personally, in a professional setting I like to do the
"core" of the system in Java or C++ because they are easier to
clean up/maintain in my opinion and then write "glue" applications/scripts
in Perl (things such as file parsers, cleanup scripts, and system monitors
and system loggers)
since these tend to change rapidly be needed right away and assist
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||