Ability to mix easily procedural, OO and functional styles of programming.
How important is this to you and are you looking for something like Python's approach to this? Do you think it offers that much more usability than just throwing everything in a class?
Frankly I'm Python ignorant (I have only walked through Python tutorial once and it was very long time ago so I forgot everything anyway :( ). Can you tell how it compares with Perl in this aspect?
Obviously a library of reusable compontents like CPAN.
Is it just the more specialized modules you find lacking from Java (the Finance::Quote type modules), or is it problems with included libraries (including lack of api choices)?
I like that fact that there is central repository of reusable tested Perl components which are easy to install. In other languages you are either stuck with core libraries or you have to hunt for other libraries over all Internet. This discourages code reuse (how many times have you heard "I don't want to use this library but rather reinvent it myself so my users are not forced to deal with many external dependanices"). One negative side is that I think in other language communities programmers contribute less in reusable libraries. Another is that you see a lot of code going in core (think PHP, think Java) making it bloated.
--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
| [reply] |
I'm not sure what you mean by talking about stuff going into the core with Java as "bloat," unless you're referring to raw download size of the JRE. It's by no means the same situation as with PHP, because Java has packages, while PHP does not. It can be quite maddening for quite a long time to figure out how one accesses one's preferred database in PHP, for example, since mysql_* and pg_* are both in the core (well, if you compile them in, they are).
You can write a reasonably functional (if verbose) program in Java without using anything outside of the java.lang package (although, heh, you can't process a file ...); OTOH, if you need to process XML and you have JDK 1.4 or later, or you want to serialize some expensive-to-construct objects in Java, you can do it without having to download anything new. Yes, the base API documentation is huge, but you can do a heck of a lot with it. It's kinda like shipping a lot of CPAN in the distribution.
It's by no means an official central Java repository of modules, and it's also by no means as comprehensive as CPAN, but the Apache Jakarta project has been developing reusable components, some of which are quite nice. I still prefer CPAN, but my point is that the Java picture is not as bleak as it is sometimes made out to be. Of course, for most textual processing, I still prefer to use Perl, but my view of Java is not as jaundiced as it used to be.
If not P, what? Q maybe? "Sidney Morgenbesser"
| [reply] |
I probably should not use word "bloat", I'd better say lack of modularization (on the other hand don't they come together often?). It irritates me as hell that when, say, I need a certain feature of Postgres API I have to upgrade to a new version of PHP. I must admit I'm not doing Java programming for quite long time but your phrase if you need to process XML and you have JDK 1.4 or later, or you want to serialize some expensive-to-construct objects in Java, you can do it without having to download anything new sounds like indication of same problem.
CPAN frees me from dependancy on core libs. I don't have to wait for a new release of Perl to get new features and/or bug fixes, I don't have to upgrade to a new release of Perl to use features and/or bug fixes. CPAN makes me free from release schedule for Perl.
--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support
UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org
| [reply] |
Frankly I'm Python ignorant
I'm fairly Perl-OO ignorant, (that's why I used Python as an example ;-) but I'm pretty sure they perform identically in respect to your comment. What I meant by the Python approach was that, in addition to the OO module approach, you can also just have a file with a bunch of subroutines and import them directly from that.
I strongly agree with your last paragraph as well, especially about causing unnecessary bloat in the core.
| [reply] |
I think the point about CPAN is that there is no single place where you can load up on Java packages. I'm sure with enough time on Google, you could probably find Java equivilents to many popular CPAN modules. In some cases, CPAN modules were even directly inspired by Java packages (Log::Log4perl, for instance). But it's spread all over the Internet instead of one easy-to-search place. And there is no Java equivilent for saying "perl -MCPAN -e 'install Foo::Bar'".
---- 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
| [reply] |