What's discouraging you from writing ruby 1.9-

2019-02-23 12:13发布

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.

6条回答
Anthone
2楼-- · 2019-02-23 12:31

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

查看更多
贪生不怕死
3楼-- · 2019-02-23 12:38

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.

查看更多
Fickle 薄情
4楼-- · 2019-02-23 12:42

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.

查看更多
姐就是有狂的资本
5楼-- · 2019-02-23 12:45

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.
查看更多
家丑人穷心不美
6楼-- · 2019-02-23 12:46

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

查看更多
女痞
7楼-- · 2019-02-23 12:53

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).

查看更多
登录 后发表回答