views:

171

answers:

6

So far, I've been merely using YARV (ruby 1.9) as merely a faster implementation of ruby than ruby 1.8, and ensured that all of my code is backwards-compatible with ruby 1.8.6. What circumstances, if any, are stopping you from writing 1.9-specific code?

One reason per answer.

+1  A: 

I wish I could forget about Iconv when handling unicode data, like this:

Iconv.conv("utf-8", "utf-16le", blob).split("\n")

but so far I could not find good examples/tutorial of 1.9 unicode handling yet.

ohho
I found this enlightening: http://blog.grayproductions.net/articles/understanding_m17n
steenslag
@steenslag, thanks for the link
ohho
Here's an even better one: http://yehudakatz.com/2010/05/05/ruby-1-9-encodings-a-primer-and-the-solution-for-rails/
SFEley
A: 

In many operating systems, it is easier to install ruby 1.8 than ruby 1.9.

  • Some distributions of Linux have packages for 1.8 but not for 1.9.
  • OS X has ruby 1.8.7 pre-installed. 1.8.7 runs the ruby 1.9 language.
  • The one-click installer for Windows is ruby 1.8.
Andrew Grimm
If you're writing a gem/library, you don't know what platform your users are using. (I wonder if we'll ever see isitruby18.com?)
Andrew Grimm
If the "don't know what platform" answer was compelling, we'd all need to keep targeting Ruby 1.6 or earlier, and no new features in the language would _ever_ be used.
SFEley
When did people switch from 1.6 to 1.8, and how did people handle things then? Or was it not really a problem because people weren't writing gems?
Andrew Grimm
+3  A: 

Also, if we're talking about rails, then the problem there is the compatibility of gems/plugins with ruby 1.9. I'm sure everyone who wants to upgrade to 1.9 keeps an eye on isitruby19.com

neutrino
+3  A: 

The first release candidate for Ruby 1.9.2 is due end of May and I believe many are waiting for 1.9.2 to hop on the 1.9 train.

Not really an answer to your question, but to start writing code uses 1.9.2 methods now, you can require "backports" and most features will be available to you, even in Ruby 1.8.6 (albeit not nearly as fast, of course).

Marc-André Lafortune
A: 

I don't know Ruby so well to distinguish 1.8 from 1.9 ( well that's my reason :P )

OscarRyz
A: 

Nothing is discouraging me. I've been using Ruby 1.9.1 for everything I do for close to a year now and had few problems. My major gems require 1.9 for various reasons (easy UTF-8, fibers, etc.) and I've felt no qualms about it. For some other trivial gems I might make a token effort to keep them 1.8 compatible, which mostly just means not using the cleaner new hash syntax.

1.9 is the current Ruby. I can see needing to keep the old Ruby around for legacy code that isn't worth updating, or having a preference for an alternative Ruby (JRuby, Rubinius, etc.) -- but it truly baffles me why so many people are still starting new projects in the slower, obsolete Ruby 1.8.x line.

SFEley