From: Tomasz Wegrzanowski Date: 2002-01-04T22:46:45+09:00 Subject: [ruby-talk:30214] Re: should I use ruby instead of perl On Fri, Jan 04, 2002 at 08:32:26PM +0900, vekkuli ketkutin wrote: > Seriously: > > I need one solution for quick scripting, testing tool development, > and making programs for my hobbies. I love Perl (no, not her -the language!) > > but oop with it is really pain. > Ruby seems to have it in the way I want it, but I'm not familiar enough > with ruby yet to make my decision. > > Perl is swiss army knife but I'm looking more finnish army knife. > Best I could get would be new perl version with full oo support > not doing: > > each(@ar){print;} > > but > > ar.each.print() > or > import com.perl.script.* > each(@ar){print;} > > I should evaluate both but I 'm so lazy, you know The problem with such questions is that people will give you answers that are completely correct and at the same time completely useless, like: * "it depends on what are you going to do with it" * "every language has some strong points and some weak points" * "you should check yourself which one you like most" * "one size doesn't fit all" Let P be the problem space, that is set of all problems that can be solved by any language. Requirements like speed are part of promlem. Let difficulty of solving a problem be defined with positive real number. No let's f_L(p) be function that gives difficulty of solving problem p \in P in language L. This function changes to some extend from one programmer to another. Now let's D(p)->R_{0+}, p \in P be interest density function, that is, function that shows what problems you are most interested in. Our task is to find L that minimizes expresion \int D(p)*f_L(p) dp Depending on D, it might be optimal to split it into {D_k}, \sum_k D_k = D, and use set {L_k} of languages instead of single language. So, you should: * provide interest density function * tell if you are going to use different language for some of your interest, most important is how likely are you to use C * tell what is difficult for you, for example how good are you at visually parsing line noise^W^WPerl or using one or another paradigm This way it's possible to come with useful solution. ---- I had problem similar to yours - I can write and read Perl easily even most of japh sigs, but I have problems with deficiency of data representation in Perl. Because Ruby is compatibile with Perl at mental level, it was easy for me to move. I can solve problems with it that i would normally use C for, because it would be very difficult in Perl. Major problem is that it has less libraries, so I had to learn how to C-extend Ruby (results are Ruby-GMP). Now I usually use Ruby instead of Perl.