Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming Ruby

Ruby 2.0.0 Released 121

An anonymous reader writes "Today version 2.0.0 of Ruby has been released. This is a stable release, and the Ruby team has done their best to make it compatible with 1.9, making it easier to migrate than it was to switch from 1.8 to 1.9. New core language features include: 'Keyword arguments, which give flexibility to API design; Module#prepend, which is a new way to extend a class; A literal %i, which creates an array of symbols easily; __dir__, which returns the dirname of the file currently being executed; and UTF-8 default encoding, which make many magic comments omissible.' There are also new built-in libraries for lazy stream and for an asynchronous exception handling API. The release includes a number of performance improvements and debug support for DTrace."
This discussion has been archived. No new comments can be posted.

Ruby 2.0.0 Released

Comments Filter:
  • by goombah99 ( 560566 ) on Sunday February 24, 2013 @12:25PM (#42995601)

    Could someone offer a comparison of ruby to perl in terms of replacing perl as a command line quickie or short admin or text processing. I use python for writing serious programs. But for getting quick things done like say shredding some text copied off a telephone directory web page to pull out a list of telphone numbers and peoples names, or parsing the text output of some unix right on the command line, perl is the right tool, python is not. If you don't know that that is true then you are not an experienced perl person.

    But I've looked at ruby syntax a bit and it looks like it might have the advantage perl has for quick ad hoc text parsing but an overall cleaner syntax.

    What I don't care a lot about is fancy pants modules like rails. If I want to do something serious there's python.

    two things I like about perl: perl is lightning fast to start from the command line so glue scripts between applications like blast and something else dont' slow things down, and the O'reily nut shell book is the thinest book (even thinner than C++) yet it's a very poerful language. (yes I have looked a Lua)

    please respond with a review of ruby for a perl enthusiast.

  • by Anonymous Coward on Sunday February 24, 2013 @02:00PM (#42996075)

    Ruby can be used for both serious projects as well as providing quick prototyping.
    Ruby is probably _the_ best language to refactor code, but with some minimal care, projects will actually rarely need much heavy-lifting because of Ruby's design-choices, powerful flexibility and lack of syntactic bloat.
    So if you're into Agile, Ruby will grow on you, indefinitely.

    You don't have to use Rails at all. Ruby is ALL INDEPENDENT LIBRARIES, even more so than Perl.
    You SHOULD take a look at *ActiveRecord* though. It rocks if you need to roll your own SQL database that much more efficiently, *all* in-code and commandline deployment.

    Ruby _can_ be used for simple "one-liners", maybe not to the same extent as Perl, but why would you when you could make a short beautiful script. Like, instead of abusing some mythological undocumented features that might change at any time?
    Ruby lacks the UGLINESS of Perl though, so if you require UGLINESS, for Pete's sake: stick with Perl!
    And of course, you won't get raw speed with Ruby, but we got C / C++ to provide that when required, probably in similar fashion as Perl. So with good planning, Ruby can actually scale pretty well in big demanding projects.

    If Ruby's efficient and beautiful syntax peaked your interest, why not just try it yourself on the next task you desire fulfilled? The language lends itself to be learnt very quickly, and for experienced programmers, those that know what they're doing, Ruby provides an extremely short time to productive results.

    I recently tried the other way: A friend recommended Perl (I've been familiar with Perl for over 15 years, however never built something from scratch in it). I made a simple graphical project using Perl docs and googling. The whole ordeal reminded me in so many ways why I prefer Ruby over Perl, or any other language. I was successful in using Perl. It just wasn't a pleasant and enjoyful experience compared to what I'm used to using Ruby.

  • by mortonda ( 5175 ) on Sunday February 24, 2013 @02:50PM (#42996371)

    I code in Ruby for a living (Rails), and I think it's a really fun language. Which is something a fair number of rubyists say, and which is something you don't hear a lot of other folks say about their language of choice. For what that's worth...

    This. So much this.

    Over the years I've used various languages to some degree... C, C++,Java, PHP, Perl.... and Ruby is simply the most fun and most expressive. I'll allow that all these languages have their strengths. (ok, not PHP [veekun.com]). Python, too has many valid proponents and use cases, but I just can't have fun in a whitespace sensitive language. Java - I think is nice for people that like to type a lot. The modern day COBOL. But if IIRC, the fastest ruby interpreter is currently JRuby, so I can't entirely fault Java. C and C++ is obviously best for kernels and libraries where speed matters a lot, but obviously horrible for web application development.

    For my own interests in web application development, Ruby on Rails is a sweet spot... I can make a lot of money doing something really fun. What's not to like about that?

  • by petsounds ( 593538 ) on Sunday February 24, 2013 @05:55PM (#42997623)

    Happy birthday to Ruby! Pretty cool the way that numeric coincidence worked out.

    2.0 looks like a nice step forwards. I'm not sure where I stand on Refinements yet. I hate the method overriding of base classes that goes on in Ruby land, and Refinements is supposed to minimize the bad affects of that by offering scoped alterations, but from what I've heard there's a lot of side effects. Frankly, I think Ruby needs a 'protected' type; any other solution is just monkeys all the way down. But I could say this about a lot of the popular languages right now.

FORTRAN is not a flower but a weed -- it is hardy, occasionally blooms, and grows in every computer. -- A.J. Perlis

Working...