From: Brian Wisti Date: 2004-09-16T02:36:03+09:00 Subject: Re: Ex-Perl coders: Howz it feel to convert to Ruby? --- Chris wrote: > I didn't even think about asking this question until now, based on a > paragraph I wrote in another thread, so I thought I would ask... > > I've had this long time infatuation with Ruby and as a fairly > proficient > Perl coder, have even recreated a few "Ruby things" in Perl over the > last few years. But a couple of "Wow!" factors in Ruby have kept me > hanging around and I've finally decided that the only way is to ween > myself off of Perl and just start using Ruby all the way. > > This is hard because I can't afford a lot of downtime, which has been > > the biggest strike for me against using Ruby. I'm fairly fast, > tight, > and concise at hitting targets using Perl and I don't want to loose > that > productivity using Ruby. Still, it appears a "hit" has to be taken > if I > really want to learn it as well as I know Perl. > > So the question for any hardcore Perl coders out there that have > converted to Perl (or are fluent in both) is: Is it really worth the > time? Are the paybacks there? And do you feel you've exceeded your > capabilities in Perl using Ruby? > > I perceive, from what I've read, that this could be the case. I see > all > these "testimonials" that claim rapid development and this is > inticing, > yet at the same time, having done *some* Ruby coding, this is a > little > hard for me to believe because in my estimation, the paradigm in Ruby > is > entirely different than in just about any other procedural language > and > even from the OO aspects of Perl, C++ and Java. To me, the > difference > between Ruby and just about anything else (common) is the same as > when, > in the development world, many of us made the leap from procedural to > > OO. I think the gap between Ruby and most everything else is that > big > -- as well as the payoffs...? > > So I'm looking for feedback from those that have converted, esp. from > a > hardcore Perl perspective. > > Thanks, > -ceo I'm not exactly an ex-Perl coder, since I still use Perl everyday at work and at home. I have found Ruby to be an excellent item in my toolkit for testing, prototyping, and creating applications where the corresponding Perl code would risk melting my brain. Note: High risk of brain-melt results in significant difficulties maintaining code. More recently, I've also been exploring the use of Ruby as a shell scripting language. Guess what? The Ruby code is freakishly similar to the Perl code for accomplishing the same tasks, minus a few punctuation symbols. This led me to my first assertion of Perl-to-Ruby transition: Brian Wisti's First Assertion of Perl-to-Ruby Transition -------------------------------------------------------- "You're probably trying too hard." Sorry, I just had to make it look all fancy like that for a second. Ego is a delicate thing, and it demands attention at all times ;-) You don't need to take advantage of every language feature to become proficient in a language. Heck, I was making useful programs in Perl for a couple years before I started using references and Perl-style objects. So look at the list, admire the cleverness of the Ruby gurus with their management of reflection, continuations, Procs, and whatnot. Then go make the programs you need to make in the way you know how. Take advantage of the similarities between Ruby and other languages. Incorporate the really neat features as you develop an understanding of them. It's okay if your Ruby code looks a little like Perl at first, or a little like C++. You'll get the hang of the "right way" as your knowledge improves. What's the payoff using Ruby instead of Perl? For me, the end result is stress reduction. It takes roughly the same amount of effort to create a small program in the two languages, but progressively less effort to create Ruby applications as the size and scope of the app increases. The Principle of Least Surprise means that most things are done like you would expect them to be (or at least like Matz expects them to be, which is still more consistent than most languages out there). It is nice to have legible code, too. I know that "legible" is entirely subjective, and you don't have to agree with it if you don't want to. You can make clean code in Perl, but it takes a little more work and a lot more discipline. Plus, all of the "my/local/our" stuff and shifting subroutine arguments and list context vs. scalar context (and, and, ...) in Perl starts to look more than a little extraneous, interfering with your reading of the actual code logic. Since Ruby doesn't use any of that stuff, it's easier for me to see the meat of the code. So that's my thoughts. And everybody else has their own thoughts as well, naturally ;-) Kind Regards, Brian Wisti brian@coolnamehere.com