Forum: Ruby 1.9.1?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0765080a8d48afe94f0903f7adb00c9c?d=identicon&s=25 yuckysocks (Guest)
on 2009-02-03 18:15
(Received via mailing list)
Hi there,

I'm about 2 weeks into my learning attempt at Ruby (1.8.6 is what I've
cut my teeth on).

Can someone give me a rational assessment of the differences between
the two language versions, and which one I should continue to pursue?

I'm mainly using Ruby with Rails to make basic webapps for my own
edification.

Thanks!

Alex
Aaca034456897ccbc8bb14953c4a41c1?d=identicon&s=25 Radosław Bułat (radarek)
on 2009-02-03 18:48
(Received via mailing list)
On Tue, Feb 3, 2009 at 6:14 PM, yuckysocks <alex.m.mcpherson@gmail.com>
wrote:
>
> Thanks!
>
> Alex
>
>

Very short answer:
- new virtual machine (previously just AST interpreter)
- memory diet for some objects (Object, Array, String etc)
- improved speed (see
http://antoniocangiano.com/2008/12/09/the-great-ru...)
- added character encoding support (previously works only with raw
bytes)
- new syntax for hashes with symbols as keys, hashes preserve keys order
- many changes to API (improved, added consistency, removed deprecated
code etc)
- changes in language semantics (for example block arguments now works
(almost?) the same as method arguments)
- new lambda literal:  ->
- external iterators (class Enumerator) now are built in
- new concept such a fiber (class Fiber)
- native threads (but with GIL like python)
- rubygems, rake are built in
- minitest supercedes old test/unit


--
Pozdrawiam

Rados³aw Bu³at
http://radarek.jogger.pl - mój blog
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Zayd Abdullah (Guest)
on 2009-02-03 19:52
(Received via mailing list)
So since these changes have been made, will us noobs be hurting
ourselves
starting off learning 1.8.6? Books to learn from are teaching from 1.8.

thanks

2009/2/3 Radosław Bułat <radek.bulat@gmail.com>
F53b05cdbdf561cfe141f69b421244f3?d=identicon&s=25 David A. Black (Guest)
on 2009-02-03 19:57
(Received via mailing list)
Hi --

On Wed, 4 Feb 2009, Zayd Abdullah wrote:

> So since these changes have been made, will us noobs be hurting ourselves
> starting off learning 1.8.6? Books to learn from are teaching from 1.8.

If you can wait about 1.5 months or so you can read "The Well-Grounded
Rubyist" (already available in early-access PDF), which is about
1.9.1. See http://www.manning.com/black2. Meanwhile there's a ton of
stuff you can learn in 1.8.6 that hasn't changed, or where the changes
are likely to make more sense to you anyway (like "abc"[0] being "a"
rather than 97).

See also my recent blog posts on 1.8/1.9:

http://dablog.rubypal.com/2009/1/14/10-things-to-b...
http://dablog.rubypal.com/2009/1/16/son-of-10-thin...


David

--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

http://www.wishsight.com => Independent, social wishlist management!
5b4aaa2337d29b4294bf12e74ded2052?d=identicon&s=25 Jonathon Brenner (Guest)
on 2009-02-03 20:01
(Received via mailing list)
Not all books. Take a look at Programming 1.9 by Pragmatic Programmers
(http://preview.tinyurl.com/7xfvk7). They constantly update their PDF
books to keep in step with the latest changes to Ruby.

Good luck.

2009/2/3 Zayd Abdullah <devrubygem@gmail.com>
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Zayd Abdullah (Guest)
on 2009-02-03 20:06
(Received via mailing list)
Hey Alex,
How is your learning process going? I'm currently learning Ruby also. I
picked up "Beginning Ruby" by Peter Cooper(Excellent read), and "Design
Patterns In Ruby". What kind of projects are you creating and practicing
to
sharpen your skills? I need some simple projects to start creating. Do
you
have any suggestions?

Thanks
Zayd
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2009-02-03 20:11
(Received via mailing list)
On Feb 3, 2009, at 12:52 PM, Zayd Abdullah wrote:

> So since these changes have been made, will us noobs be hurting
> ourselves starting off learning 1.8.6? Books to learn from are
> teaching from 1.8.

No, you will be fine.  It's not a super tough transition when you are
ready.

James Edward Gray II
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Zayd Abdullah (Guest)
on 2009-02-03 20:13
(Received via mailing list)
Thanks Guys. So in a short list, what should be the features to stay
away
from in 1.8, I just purchased "Beginning Ruby" by Peter Cooper, I really
would hate to struggle trying to get something then find out its no
longer
needed or being used in 1.9 lol.

Thanks

2009/2/3 Jonathon Brenner <jonbrenner@gmail.com>
D68c97e8e2f1653b54c24493caf236ae?d=identicon&s=25 Stephen Celis (Guest)
on 2009-02-03 20:20
(Received via mailing list)
Hi,

On Feb 3, 2009, at 12:52 PM, Zayd Abdullah wrote:

> Books to learn from are teaching from 1.8.

In addition to those already mentioned in this thread, Flanagan's _The
Ruby Programming Language_ (O'Reilly) is a great book in general and
touched on Ruby 1.9 even though it was published over a year ago. It's
not completely up to date with 1.9.1, but covers many of the
conceptual changes.

Stephen
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Zayd Abdullah (Guest)
on 2009-02-03 20:21
(Received via mailing list)
WHEW!! :) okay cool

Thanks
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2009-02-03 20:23
(Received via mailing list)
On Feb 3, 2009, at 1:05 PM, Zayd Abdullah wrote:

> I need some simple projects to start creating. Do you have any
> suggestions?

You might try some of the easier questions from Ruby Quiz:

   http://rubyquiz.com/

The problems a bunch of people solved are generally the easiest.  For
example, have a look at:

   http://rubyquiz.com/quiz14.html

and:

   http://rubyquiz.com/quiz84.html

James Edward Gray II
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Musdev Musdev (devrubygem)
on 2009-02-03 20:31
James Gray wrote:
> On Feb 3, 2009, at 1:05 PM, Zayd Abdullah wrote:
>
>> I need some simple projects to start creating. Do you have any
>> suggestions?
>
> You might try some of the easier questions from Ruby Quiz:
>
>    http://rubyquiz.com/
>
> The problems a bunch of people solved are generally the easiest.  For
> example, have a look at:
>
>    http://rubyquiz.com/quiz14.html
>
> and:
>
>    http://rubyquiz.com/quiz84.html
>
> James Edward Gray II


Thanks James I will try some of the easier ones :)
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2009-02-03 20:53
(Received via mailing list)
2009/2/3 Zayd Abdullah <devrubygem@gmail.com>:
> So since these changes have been made, will us noobs be hurting ourselves
> starting off learning 1.8.6? Books to learn from are teaching from 1.8.

I think things are looking up for Ruby 1.9 books, actually.  Here's
the path I'd recommend (with some obvious bias)

= To grasp the fundamentals

"The Well Grounded Rubyist" [0]

= To understand the details

"Programming Ruby 1.9" [1]  and/or "The Ruby Programming Language" [2]

= To use Ruby effectively

"Ruby Best Practices" [3]

----

This will give you a very well rounded experience, and once you
understand Ruby 1.9, quite a bit of your knowledge will still transfer
smoothly back to 1.8.
Most of these books are in Beta right now, all except [2], but if you
pick them up know you will help us catch problems before we go to
print, improving the situation for those taking the plunge directly
into Ruby 1.9.

-greg

[0] http://www.manning.com/black2/
[1] http://www.pragprog.com/titles/ruby3/programming-ruby-1-9
[2] http://oreilly.com/catalog/9780596516178/
[3] http://rubybestpractices.com
3131fcea0a711e5ad89c8d49cc9253b4?d=identicon&s=25 Julian Leviston (Guest)
on 2009-02-04 01:54
(Received via mailing list)
Keep going with 1.8. There's more in 1.9 and strings are unicode.

Blog: http://random8.zenunit.com/
Learn rails: http://sensei.zenunit.com/

On 04/02/2009, at 4:14 AM, yuckysocks <alex.m.mcpherson@gmail.com>
Aae5c9f81fe990a48daf2bb91ac82759?d=identicon&s=25 Diego Virasoro (Guest)
on 2009-02-04 11:25
(Received via mailing list)
On Feb 3, 7:12 pm, Zayd Abdullah <devruby...@gmail.com> wrote:
> Thanks Guys. So in a short list, what should be the features to stay away
> from in 1.8, I just purchased "Beginning Ruby" by Peter Cooper, I really
> would hate to struggle trying to get something then find out its no longer
> needed or being used in 1.9 lol.
>

I'd definitly put the whole string encoding: that's changed pretty
much completely. And there are a few more things within the string
class but they are pretty minor. Also there's some trickery about
variables scopes in 1.8 that has been "fixed" in 1.9.1.

But as others said for most people the transition from 1.8 to 1.9
should be pretty painless (transitioning the actual codes may be
another matter, I don't know). And if you are stuck at any point, feel
free to send a message to this list and I am sure you'll get tons of
advices plus people will warn you if that's something that's been
changed in 1.9.

So in the end, enjoy learning 1.8: 1.9 is still pretty similar! :)

Diego
78947e02afdcaabbda360f9d112bfbe0?d=identicon&s=25 Musdev Musdev (devrubygem)
on 2009-02-04 18:36
(Received via mailing list)
Thanks Guys!!
851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2009-02-05 04:10
(Received via mailing list)
On Tue, 03 Feb 2009 09:14:42 -0800, yuckysocks wrote:

>
> Thanks!
>
> Alex

AFAIK, Rails isn't available for 1.9 yet, and much of the good stuff in
the Ruby 1.9 APIs is actually inspired by and taken from Rails. Stick
with 1.8 for now. Learning the new stuff for 1.9 should be relatively
easy -- I've been able to move some code I've written for 1.8, and run
it
on 1.9 without changes and all unit tests pass.

--Ken
Aaca034456897ccbc8bb14953c4a41c1?d=identicon&s=25 Radosław Bułat (radarek)
on 2009-02-05 09:40
(Received via mailing list)
On Thu, Feb 5, 2009 at 4:09 AM, Ken Bloom <kbloom@gmail.com> wrote:
> AFAIK, Rails isn't available for 1.9 yet, and much of the good stuff in
> the Ruby 1.9 APIs is actually inspired by and taken from Rails.

I don't think so. I can name only one thing (Symbol#to_proc) which was
popularized by rails (and even not invented by rails itself).



--
Pozdrawiam

Rados³aw Bu³at
http://radarek.jogger.pl - mój blog
F53b05cdbdf561cfe141f69b421244f3?d=identicon&s=25 David A. Black (Guest)
on 2009-02-05 13:42
(Received via mailing list)
Hi --

On Thu, 5 Feb 2009, Radosław Bułat wrote:

> On Thu, Feb 5, 2009 at 4:09 AM, Ken Bloom <kbloom@gmail.com> wrote:
>> AFAIK, Rails isn't available for 1.9 yet, and much of the good stuff in
>> the Ruby 1.9 APIs is actually inspired by and taken from Rails.
>
> I don't think so. I can name only one thing (Symbol#to_proc) which was
> popularized by rails (and even not invented by rails itself).

There's also #each_with_object.


David

--
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)

http://www.wishsight.com => Independent, social wishlist management!
8f6f95c4bd64d5f10dfddfdcd03c19d6?d=identicon&s=25 Rick Denatale (rdenatale)
on 2009-02-05 14:28
(Received via mailing list)
2009/2/5 David A. Black <dblack@rubypal.com>

>> I don't think so. I can name only one thing (Symbol#to_proc) which was
>> popularized by rails (and even not invented by rails itself).
>>
>
> There's also #each_with_object.
>

No, it looks like this went from Ruby 1.9 TO Rails

http://rails.lighthouseapp.com/projects/8994/ticke...

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
988224e2883cee6a4a7f0312e91fe231?d=identicon&s=25 jawad zoubian (Guest)
on 2009-02-05 15:29
(Received via mailing list)
unsescribe me.

2009/2/3, yuckysocks <alex.m.mcpherson@gmail.com>:
> edification.
>
> Thanks!
>
> Alex
>
>


--
Jawad ZOULGAMI
Omnidata
74,Bd Abdelmoumen
20100 Casablanca - Maroc
Gsm: +212 (0) 67 43  25 78
jzoulgami@omnidata.ma
www.omnidata.co.ma
4299e35bacef054df40583da2d51edea?d=identicon&s=25 James Gray (bbazzarrakk)
on 2009-02-05 16:12
(Received via mailing list)
On Feb 5, 2009, at 6:40 AM, David A. Black wrote:

>>> stuff in
>>> the Ruby 1.9 APIs is actually inspired by and taken from Rails.
>>
>> I don't think so. I can name only one thing (Symbol#to_proc) which
>> was
>> popularized by rails (and even not invented by rails itself).
>
> There's also #each_with_object.

I believe Enumerable#group_by also migrated from Rails.

James Edward Gray II
Aaca034456897ccbc8bb14953c4a41c1?d=identicon&s=25 Radosław Bułat (radarek)
on 2009-02-05 18:04
(Received via mailing list)
2009/2/5 James Gray <james@grayproductions.net>:
>>>> AFAIK, Rails isn't available for 1.9 yet, and much of the good stuff in
>>>> the Ruby 1.9 APIs is actually inspired by and taken from Rails.
>>>
>>> I don't think so. I can name only one thing (Symbol#to_proc) which was
>>> popularized by rails (and even not invented by rails itself).
>>
>> There's also #each_with_object.
>
> I believe Enumerable#group_by also migrated from Rails.
>

It is also in ruby facets. I guess that facets invented many things
that was imported to rails but I don't know what about group_by.



--
Pozdrawiam

Rados³aw Bu³at
http://radarek.jogger.pl - mój blog
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2009-02-05 18:16
(Received via mailing list)
2009/2/5 Rados³aw Bu³at <radek.bulat@gmail.com>:

> It is also in ruby facets. I guess that facets invented many things
> that was imported to rails but I don't know what about group_by.

Facets *collects* many more things than it invents.

-greg
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-02-05 18:52
(Received via mailing list)
Rados³aw Bu³at wrote:
> On Thu, Feb 5, 2009 at 4:09 AM, Ken Bloom <kbloom@gmail.com> wrote:
>> AFAIK, Rails isn't available for 1.9 yet, and much of the good stuff in
>> the Ruby 1.9 APIs is actually inspired by and taken from Rails.
>
> I don't think so. I can name only one thing (Symbol#to_proc) which was
> popularized by rails (and even not invented by rails itself).

HashWithIndifferentAccess?
31e038e4e9330f6c75ccfd1fca8010ee?d=identicon&s=25 Gregory Brown (Guest)
on 2009-02-05 19:33
(Received via mailing list)
2009/2/5 Phlip <phlip2005@gmail.com>:
> HashWithIndifferentAccess?
What does this have to do with Ruby 1.9 inclusions?

sandal:~ $ irb19
>> { :a  => 1 }["a"]
=> nil

>> HashWithIndifferentAccess
NameError: uninitialized constant HashWithIndifferentAccess
  from (irb):2
  from /Users/sandal/lib/ruby19_1/bin/irb:12:in `<main>'


Unless it's under another name, I think this was an idea that was
toyed with a while ago and dropped.

-greg
This topic is locked and can not be replied to.