Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a tutorial that teaches common Ruby programming idioms used by experienced programmers, but may not be obvious to newcomers? [closed]

Tags:

idioms

ruby

I'm looking for a Ruby's equivalent of Code Like a Pythonista: Idiomatic Python

Desirable features:

  • easy to read
  • single document which covers all topics: tips, tricks, guidelines, caveats, and pitfalls
  • size less than a book
  • idioms should work out of the box for the standard distribution (% sudo apt-get install ruby irb rdoc)

Please, put one tutorial per answer if possible, with an example code from the tutorial and its meaning.

UPDATE:

These are the most closest to the above description resources I've encountered:

  • Ruby Idioms
  • Ruby User's Guide
like image 965
jfs Avatar asked Sep 17 '08 18:09

jfs


People also ask

Where can I learn Ruby programming language?

Udemy. If you want to learn Ruby programming language and are looking for a suitable platform for this purpose, then Udemy is the best place to start. It provides a tutorial about so many different courses. Here, you can learn about Ruby in a much easier and simpler manner as compared to other online tutorials.

How many types are there to structure and execute the Ruby program What are they?

There are five types of variables supported by Ruby.

What is the structure of Ruby program?

Ruby is an object-oriented language, so the program is structured by defining classes and modules and their methods. Ruby has open classes that can be changed any time (even the core ones, like String ). To localize class changes and implement hygienic extensions, one can use refinements.


1 Answers

Ruby Idioms (originally from RubyGarden) is my usual reference for idioms. It's clearly organized and fairly complete. As the author says, these are from RubyGarden, which used to be really cool (thanks Wayback Machine). But now seems to be offline.

like image 138
Gordon Wilson Avatar answered Sep 21 '22 18:09

Gordon Wilson