In article LLENJLJKHAOFKOLPKLAFGEKBCAAA.zdennis@mktec.com,
Hi,
We’ve got a small project coming up at work that will deal with a MySQL
database. It will be a small scale inventory management and
production/purchase order management system. We are trying to decide what
language to write it in. We have ruled out Java, C, C++, anything .NET and
Python. We have Ruby and Perl left on our list(although we may include C
extensions).
Much of the data and transactions can be conceived to be very OO, which is
why I picked Ruby. Another fellow on my team though feels that since Perl is
older then Ruby and has OO ability that it is better to use because there
are more books, documentation, etc…(in English).
Sure you can do OO Perl… you could probably do OO Assembly too if your
pain tolerance is high enough.
Turns out that OOPerl tends to run slower than Ruby, so if you’re planning
to do the project in an OO style, you should keep that in mind.
(of course, procedural Perl is faster than Ruby in general).
The system will need to deal with different types of Queues and Threads
since it will spawn across 2 servers and have multiple users on multiple
workstations. It will also need to eventually interact with UPC Scanners.
Any particular reasons why or why not Ruby or Perl? We have a small list of
pros and cons, but I thought I might get some more insightful answers here.
I can only give you my experience in moving from Perl to Ruby (which for
me happened in early 2001): We were developing a distributed test system
that also needed to run on several machines (similar to your requirement).
I started out in OO Perl, but soon I decided that the code-base was just
becoming unwieldly cumbersome. I looked at Ruby and within a couple of
weeks of getting the pickaxe book, I was more productive in Ruby than I
had been in Perl (and I had programmed primarily in Perl for several
years). (drb helped a lot with that project as well, you might want to
look into it.)
Perl as it is now has had it’s day and now is starting to look a bit
too old. I wouldn’t recommend Perl for any real production system at
this point when there are much better alternatives available now (and I
used to be a big fan of Perl). Perl6 may change my mind, but it’s still
vaporware at this point.
I think the main advantages Ruby offers over Perl are in the following areas:
- Maintainability (and readability): It’s nice to come back to your code
six months later and have a good idea of what you were trying to do
and what you were thinking back when you wrote it. One of the things
that annoyed me the most about Perl readability was that you couldn’t
tell what arguments a function took just by quickly glancing at the code
since they pass arguments via the @_ array. You had to look through
the whole function to see what was being shifted off of @_.
- Real support for OO with a very nice Smalltalk-like model. OO is not a
do-it-yourself, ad-hoc afterthought as it is with Perl.
- enhanced productivity (in my experience, anyway, YMMV).
- very easy to write C extensions for Ruby. (to be fair, this has
improved for Perl as well since the Inline modules have become
available)
Sure, Ruby’s RAA isn’t as large as Perl’s CPAN, but you’ll find a lot more
functionality built-in to Ruby’s libraries than you will in Perl - for
example, look at all of the built in functions for arrays in Ruby vs.
Perl - so you’ll find yourself reaching outside for special libraries less
often than you need to with Perl.
Perl was great in it’s day (5 to 10 years ago), but times have changed.
Phil
···
Zach Dennis zdennis@mktec.com wrote: