Hacker News new | past | comments | ask | show | jobs | submit login
The Ruby Refresher (muthanna.com)
89 points by Garbage on March 17, 2012 | hide | past | favorite | 10 comments



This is quite cool. I'd love to see other languages. For example, I haven't written Python in a while - it'd be great to have a refresher for it.


Very nice. But it would be helpful to see the output too, perhaps on the right side of the screen.


A good companion to, and maybe a replacement for, the Ruby QuickRef (http://www.zenspider.com/Languages/Ruby/QuickRef.html).


This is wrong:

primes = [2, 3, 5, 7]

puts primes[0..3] # => [2, 3, 5]

It actually outputs [2, 3, 5, 7]. I believe the author meant to write:

puts primes[0...3] # => [2, 3, 5]

Had trouble finding an email on his blog page. Hopefully the author is reading here.


It's on Github, so you can send a pull request here: https://github.com/0xfe/rubyrefresher


[0, 3] could also have that behavior (3 elements from 0)


Awesome! This will help in my learning ruby from Python, thanks!


For syntax comparisons to help you go from Python -> Ruby, you can check out http://hyperpolyglot.org/scripting


Nice... please add this to exceptions:

def hello rescue end


Also useful: a comparison of languages, cookbook style: http://pleac.sourceforge.net/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: