Related
As far as I can tell, a complete English translation of the Ruby Hacking Guide does not exist. I find this unbelievable given the fact that it was originally written in 2004. Of course, a few attempts have been made:
The RubyForge project is ostensibly the most official, but even a cursory look through the mailing list archives reveals that it has low traffic and is more or less dead.
C. E. Thornton also took a stab at translating it, calling his version the Integrated Ruby Hacker's Guide. While substantial, it too is incomplete: the "blue" chapters are machine translated.
This site gives the most thorough background that I could find.
My questions are as follows.
Does anyone know if there is another significant English translation of the Ruby Hacking Guide available?
Is there an active translation effort in progress?
Even if someone were to produce an English version of the Ruby Hacking Guide, would it still be relevant?
Apart from the Ruby Hacking Guide, what is the best resource for English-speaking developers who want to work on/understand Ruby internals?
The most important stuff is already translated in your links. Ruby has changed a lot since 2004, especially with 1.9. It would be better to write a new Ruby Hacking Guide instead of translating the old one.
I read a lot of books about Ruby but the Dave Thomas' screencast was by far the best on understanding the ruby fundamentals.
http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming
There is always the option to read the original source code of Ruby. A good alternative is the source code of http://rubini.us/ as most of it is already in Ruby.
http://ruby-hacking-guide.github.io had its translation completed in September 2013.
The site is based on https://github.com/ruby-hacking-guide/ruby-hacking-guide.github.com . Some minor changes have been made since September 2013.
I suppose this is two very closely related questions:
Everyone says to start with Why's (Poignant) Guide to Ruby, and I can't stand that book; what's another good starting point for an experienced programmer that has a more serious tone?
If I'm not the sort of person who appreciates _why, should I skip Ruby because the community will not be to my taste?
I'm currently rolling through Programming Ruby: The Pragmatic Programmer's Guide. So far I think the concepts are well-defined by the authors, and the examples provided help clarify any misunderstandings. The book is available for free online or you can order a copy:
http://www.ruby-doc.org/docs/ProgrammingRuby/
Update: More current version of book (Thanks bgporter)
http://pragprog.com/titles/ruby3/programming-ruby-1-9
The only problem with the online version is that it is a little outdated. I don't know Ruby that well yet so I can't say how much of the book is still valid in all cases, but the examples have worked for me so far when I run them. Note that the book available for purchase is up to date. It's hard to beat free, so be sure to check this guide out.
That being said, I don't think you should skip out on Ruby just yet. I've had a blast learning the language so far, and I'm looking forward to doing some full-fledged web development with Rails soon. At the very least give the language a chance; I think you'll find it a joy to work with.
I bought a lot of books learning ruby, the Well Grounded Rubyist was hands down the best.
And while we aren't really a community of _whys, we are a community of people who appreciate creativity and cleverness in code. If you are the sort of person who thinks there should only be one way to do something, and that way should be the clearest and most straight forward possible, python is probably for you. If you are the person who likes to push the language as far as it will go to create interesting and clever APIs, ruby is probably for you.
The Ruby Programming Language.
Programming Ruby would be my choice. It's also known as the Pickaxe book because of the cover:
It's a great introduction to Ruby. Why they still have the huge API reference in it in this day and age escapes me, though. It makes it thick as a brick, which is its only fault.
You can also find it online, although I think it's the first edition, which is well dated: http://ruby-doc.org/docs/ProgrammingRuby/. The third edition is the one in print now, it was updated just months ago and covers Ruby 1.9.2, which is the latest version of Ruby at this time.
I don't particularly like _why either. He created some great libraries, but I can't stand the Poignant guide, nor any of the talks he made. You don't have to like him, or be like him to belong in the Ruby community.
Ruby Koans are great for learning those small things that make Ruby unique.
It's basically set of excercises that show you how things work. Each excercise is in form of a failing test, and you have to make sure it passes. And they're fun! :)
If you're going to do them all, I also suggest enabling autotest, so you won't have to run them manualy. This article explains how.
Not everyone says start with Why's book, for instance, me.
Here's a quick list of my on-disk Ruby books and references. You can search for their individual titles on the interwebs. Some are commercial, and some are free. I linked the ones that are part of an app's documentation that I saved as PDFs so I'd have them on my laptop.
Agile Web Development with Rails
Programming Ruby
Ruby Best Practices
Sequel cheatsheet
Sinatra Book
The Ruby Cookbook
The Ruby Programming Language
The Ruby Way
The Well Grounded Rubyist
Why's book is worthy, but reminds me of Hunter S. Thompson trying to write a programming book, complete with Ralph Steadman drawings, which really disturbs me.
Also, don't overlook using ri, which is the on-disk reference to Ruby's libraries and gems. Also, the core library and standard library docs are really useful.
I was in your position this summer. Why was not for me, but I did find an excellent online resource: http://railstutorial.org/. It is actually for learning Ruby on Rails, but you can use it to learn Ruby as well. I'm not very experienced but I believe you can be part of the Ruby community without appreciating Why :-).
http://railsforzombies.org/ is a nice one , although it is not a book
Chris Pine's Learn to Program It's very straightforward. I started learning right away. It was very encouraging.
My colleague has written an excellent post summarizing starting points, books to read and paths to follow when learning ruby at http://www.jasimabasheer.com/posts/meta_introduction_to_ruby.html
I'd recommend taking a look at it, it has a wealth of information.
To add more info to the answers above, not really a book to learn ruby but a some companion resources for the learning process:
Ruby Language Quick Ref
Essential Ruby Refcard
I am required to automate software tests for my job and I currently use groovy to do this. However, I am thinking about adding Ruby to my repertoire. Mainly because I can see myself working on a rails project in the future.
How long do you think it would take to become relatively proficient at scripting with Ruby? I am talking mainly navigating around a DOM with webdriver/webrat and programatically doing text/file changing work.
One weekend of intense dedication.
Seriously, it's a matter of how much time you have got on your hands and what's your previous experience. If you've dabbled in Perl or Python, you'll probably have an easier time picking up Ruby than if you had just used Java before.
Depends on how much experience you have with other programming languages. You should be able to learn the basic ruby syntax in an afternoon. And then work on learning the testing libraries might take another couple of days of playing around with them. You certainly wont be a ruby expert but you should be able to hack together some test scripts pretty quickly.
You could start here -
Ruby in Twenty Minutes
Then maybe go here -
17 Videos Covering Basic Ruby Techiques
If you have programming experience I would say 2 weeks of intense focus on ruby will get you 99% of way....the major features of ruby that distinguish it from other scripting languages are its intrinsic use of iterators (you almost never code for or while loops) and associated code blocks. Once you become familar with these the rest of it falls into place.
A minute to learn ... a lifetime to master.
With no previous technical experience I started learning ruby, html, css etc at the same time and it took me 2 years before I could get something up and know what was actually going on. Rails of course makes all of this faster and if you already know other programming languages you could tackle the basics and be functional in 6 months.
Ruby has Nokogiri, which is an excellent HTML/XML parser. It supports both CSS and XPath accessors, making it very easy to navigate through a parsed HTML file's DOM.
Building on top of Nokogiri is Mechanize, which was based on Perl's WWW::Mechanize. It makes it easy to navigate through a website's pages, extracting fields, filling out forms and submitting them, tracking cookies and sessions, etc. Because Mechanize is built on top of Nokogiri, you can get at the underlying DOM and use the same CSS and XPath accessors.
Ruby has several different testing environments. Test::Unit comes with Ruby and is easy to use. There's also Autotest, RSpec, Shoulda and Cucumber to name a couple others. Autotest is nice because it will watch your directory and run tests as you modify the files, so you're instantly aware if you break something.
I came to Ruby from a Perl and Java background, with C/C++ before those. To me, Ruby is like a child of Java and Perl because it has some similarities to both, but at the same time the things that were annoying with both those languages are nicely sidestepped on Ruby. It's almost as if Ruby was the logical growth, or next generation, of the other two. I think that's partly the benefit of hindsight, and of Matz' intention to make Ruby be a language for programmers, not machines.
I tried learning Rails in parallel with Ruby, but caught Rails as it changed from v1 to v2. All the books were out of date and wrong, most websites were wrong, and finding good information was tough. Eventually I realized the confusion was in the documentation and backed away from Rails for six months and concentrated on Ruby, using it daily at work. I began using it almost exclusively because I was able to more succinctly express ideas in it than I could in Perl. I could write more tersely in Perl, but it wasn't as readable, which is important to me because that helps make code maintainable.
Now, a few years later, I prefer Ruby over any language I've ever used. I still program in Perl but evangelize Ruby at work, and use it any time I need to write something that touches a database, because of Sequel, or to write web front ends to the databases using Rails, Sinatra or Padrino, combined with HAML.
Depends, are you using any other scripting languages? Ruby is pretty straight-forward to some people. I found it easy to remember most of the common method names. If you've worked with other languages to any decent extent then it shouldn't be more than a week to be deeply enjoying the language. If it's your first time programming, you need to get a good solid grip on Object Oriented Programming to truly appreciate it.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Sometimes it feels that my company is the only company in the world using Ruby but not Ruby on Rails, to the point that Rails has almost become synonymous with Ruby.
I'm sure this isn't really true, but it'd be fun to hear some stories about non-Rails Ruby usage out there.
One of the huge benefits of Ruby is the ability to create DSLs very easily. Ruby allows you to create "business rules" in a natural language way that is usually easy enough for a business analyst to use. Many Ruby apps outside of web development exist for this purpose.
I highly recommend Googling "ruby dsl" for some excellent reading, but I would like to leave you with one post in particular. Russ Olsen wrote a two part blog post on DSLs. I saw him give a presentation on DSLs and it was very good. I highly recommend reading these posts.
I also found this excellent presentation on Ruby DSLs by Obie Fernandez. Highly recommended reading!
I use Ruby extensively in my work, and none of it is Rails (or even web) based.
My domain is usually client-side Windows applications (wxRuby GUI) and scripts, automating Excel, Internet Explorer, SQL Server queries and report generation (win32ole COM automation). I also use the sqlite, pdf-writer, and gruff libraries for various data munging and graph generation tasks.
Rails' success has been great for Ruby, but I agree that Rails has received so much attention that Ruby's value beyond the web is often overlooked.
We are mainly a C++ shop, but we've found several areas where Ruby has proven quite useful. Here are a few:
Code Generation - Built several DSLs to generate C++/Java/C# code from single input files
Build Support
scripts to generate Makefiles for unix from Visual Studio Project Files
scripts for building projects and formatting the output for Cruise Control
scripts for running our unit tests and formatting the output for Cruise Control
scripts for manipulating Visual Studio projects and solutions from the command line
Integration Tests - We can crank out tests much quicker and cleaner using Ruby than C++
QA's entire testing suite is written in Ruby
Ruby is basically my go to tool for where it makes sense. And it makes sense in a lot of places.
Google Sketchup uses Ruby as an embedded scripting language. You can use it to perform all sorts of 3d modeling and import/export tasks. The scripting works with the free version and there's even decent documentation.
Ruby with a homebrew extension written in C++ does all the heavy pixel pushing for my photography processing. I was using Python+numpy but when doing artsy stuff, Ruby is just more fun. Also the relative lack of, or lesser maturity of, good image processing libraries makes me feel less like i'm reinventing wheels. I am clueless about Rails, other than i've heard of it, have a fuzzy idea what it is, and actually have a book on it (unopened)
We use Watir (Ruby library) to test our .net web application.
Check out Shoes, a simple API for building GUIs in Ruby aimed at novice programmers.
Or you could use Ruby to make music ala Giles Bowkett's Archaeopteryx. This presentation by Giles about Archaeopteryx is one of the best presentations ever. I highly recommend it.
RubyCocoa and MacRuby. Possible to make full Cocoa-based GUI apps without Rails. And then you get to use Interface Builder, too.
I worked on a museum project last year that used a lot of Ruby. (http://http://ourspace.tepapa.com/home)
The part that I spent most of my time on was an interactive floor map. The Map on the floor has sensors so when people walk on it lights are triggered and displays in the wall show images or videos and audio tracks are played.
All the control code for this part of the exhibit is ruby. I wrote C interfaces with ruby wrappers to communicate with the floor sensors and the lighting controllers. The system queries a MYSQL database for the media files to be displayed and then tells computers in the walls to play the media via UDP.
It's the most reliable part of the entire exhibit.
Ruby was used for the other major part of the exhibit, the Wall though I didn't have much to do with that. Most of the graphics were prototyped in ruby using interfaces to OpenGL, a bit of Cocoa and a physics library before being ported to pure Obj-C.
Puppet and Chef: DevOps
I didn't see a mention of Puppet or Chef in the 30 answers that preceded my arrival. Ruby appears to dominate current work in cloud automation and is the base, extension, and templating language of these two big players. They are used primarily to distribute system and application configuration information for server arrays and for general IT workstation management.
The DevOps field is quite Ruby-aware. Today, Perl has a competitor. While a really simple script may often still be written directly for sh(1), a complex task now might be done in Ruby rather than Perl.
The only site I've done with Ruby at work is using Rails, but I'd like to try Merb.
Other than that I do a lot of little utility programs in Ruby - for instance an app that reads RSS feeds and imports new posts into a dabase.
It's fun, so I also write some dumb stuff just because it's so quick. Yesterday I wrote an app to play the Monty Hall problem 100,000 times to help a friend convince her professor that switching is the correct strategy.
I almost take insult that ruby is a rails thing. It is like back when CGI was the latest trend and everyone figured that if you knew perl you must be doing it only because you programmed CGI apps. Ruby is just a scripting language for me, although not as mature as python so I somewhat regret having to jump through some of its hoops and recent changes, I still like it and use it. Although I work in a java shop and therefore groovy is the ideal choice for a scripting language, I still use ruby at home and for throw away scripts that aren't needed to be shared at work.
I was considering getting into RoR from all the buzz and how quick/simple it is, but after looking over rails I didn't see anything at all that was amazing or even the least bit innovative or rapidly fast about its development compared to any other framework. The only benefit I saw was that I could code in ruby, which would be nice, but initial setup, server maintenance and scaling is more difficult, thus re-offsetting the pleasure of coding in ruby.
I created a presentation -- coincidentally named Off The Rails -- to discuss Rack-based web applications:
https://github.com/alexch/Off-The-Rails
The git repo includes slides in Markdown format and sample code (in the form of running applications and middleware). Here's the abstract:
Ruby on Rails is the most popular web application framework for Ruby. But it's not the only one! If you think Rails is too big, or too opinionated, or too anything, you might be happy to learn about the new generation of so-called microframeworks built on Rack. And since Rails 3 is itself a Rack app, you don't have to give up Rails to get the benefit of Sinatra routes or Grape APIs.
And here are some references:
This talk lives at https://github.com/alexch/off-the-rails
Yehuda's #10 Favorite Thing About Ruby
Rack
rack-test
rack-client
Sinatra
Grape
Vegas
Siesta
Rerun
Hope you find it useful!
I'm mostly a Web developer, and I learned Ruby to use Rails, but I like the language so much that I started developing a desktop Swing application in Ruby, using JRuby and Monkeybars. I'm competent in Java, but don't much like using it, and the Swing API is horrible, so putting Ruby on top has been a big win.
We mainly use rails, but we have plenty of other non-rails ruby things - for example a standalone authentication daemon thing for centralized authentication of users, and an 'image processing server' which runs arbitrary numbers of ruby processes to process images in parallel.
Oh, and don't forget good old Rake :-)
Ruby is also used for Desktop application. Especially the use of JRuby to develop Swing desktop application.
I've used Ruby at work for
A data extractor, generating csv files from binary output.
A .ini file generator, turning a simple syntax into a repetitive .ini format.
A simple TCP/IP server, acting as stand-in for the customer's system during testing.
We use Ruby to implement our test automation software. This includes test framework and driver code for Selenium RC, WATIR and AutoIT.
Ruby is powerful enough to create comprehensive applications that can interface with Test tools like Selenium or WATIR, while at the same time reading from data files, interacting with a remote Windows UI and performing near transparent network communication. All while running on Windows or Linux.
The uncluttered syntax makes it ideal for new and inexperienced programmers to read. While its totally OO nature makes it easy for these same programmers to apply good (recently learned) OO techniques, from the start.
The flexible nature of Ruby's syntax also makes the use and creation of DSLs much easier. This allows less-technical people to get invovled, read and possibly create there own tests.
I have used Ruby for code generation of C# and T-SQL stored procedures in a project with unstable requirements. The data model was encoded in a YAML file and .erb templates were used for the classes and stored procedures. It also allowed for a much more DRY solution than would have been possible with straight C# as repetitve code could be factored out into a single method in the code generator.
Where I work, we use Ruby to do a number of different one-off type batch jobs. One example of that is a job that interacts with Amazon's S3 service. At the time, the Ruby S3 library was probably the easiest one out there for us to get up and running in a short amount of time.
I wrote an order processing expert system (see DSL answer as well), converted 100k lines of customer specific perl into about 10k lines of ruby handling dozens of customers. No web components at all, no Rails.
I am a webdriver user. ruby is used by webdriver for automating the build process thanks to rake. see http://code.google.com/p/webdriver/ for details
Heh, great question.
I used Ruby to convert Excel spreadsheet airport facility data to sqlite3 for the android phone platform while making an app for pilots.
I use Ruby with Sinatra which is much simpler than Rails. I did use Rails but just found that it has turned into a bit of a monster, although Rails is still amazing compared to web frameworks available for Java.
The main feature of Ruby that I love however is "eval" and "method_missing", which Rails actually uses for example in ActiveRecord so that you can use the amazing "find_by-field-name-" queries.
I used Ruby for a lot of back-end code simply because I was the only person who was tasked to do it and needed a nice clean language that allowed me to be very productive and write easy to maintain code. I find Ruby allows me to do that easier than Perl and Python. Other people's mileage might vary on that but it works well for me.
Besides that, I like how Sequel and Nokogiri work. I also used ActiveRecord for a while separately from Rails.
We use some Ruby for file manipulation but have not been able to incorporate rails yet.
I've used Ruby a lot professionally for quick scripts for things like shuffling files around. I'm the same way in that I was using Ruby first before touching Rails at all.
In Boulder there was an excellent group of Ruby users who met monthly. This point was made - that Ruby does have an existence beside its use in Rails. Plain Ruby users do exist, are begging for attention, have neat things to show, and can find each other at user group meetings.
They also had better pizza than the Python group, who met also the same day of the month. Can only pick one...
While we do have several Rails apps at work, we also use Ruby for some fairly intensive non-web stuff.
We've got an SMS delivery daemon, which pulls messages from a queue and then delivers them, and credit card processing daemon which other apps can call out to, which makes sure there's a central audit trail.
I've found Ruby to be very attractive; I like the fact that everything is an object and its syntax is very appealing.
I was hoping that it would gain a lot of popularity this year, but I don't see lot of activity in Ruby.
For instance if we take the number of tags added in SO there are only about 700 questions tagged as "ruby." This may be because:
Ruby is so easy, noone has any questions.
This site attracts more from the.Net community and Ruby developers ignore its existence.
There are not as many Ruby projects as there projects in other programming languages.
Other resources show Ruby is not as popular as other programming languages.
What reasons do you think are behind this?
Links:
TIOBE Programming Community Index for October 2008
StackOverflow tags
Ohloh
You're mistakenly attributing something to Ruby. RubyForge alone reports over 1,000 open-source projects, let alone all Ruby on Rails apps that exist, and the projects hosted on Github, Sourceforge, and elsewhere.
Unless you spend a lot of time on other sites (Reddit is a good example) you will be unaware of just how .NET/Oracle/SQL Server/etc.-centric Stack Overflow is. (I use a Greasemonkey plugin to hide a broad swathe of these Windows- and "Enterprise"-centric technologies, because they don't interest me.)
I actually had the complementary experience to you: I started spending time on Stack Overflow, and had something of a "woah" moment when I realized just how many people spend their days futzing with ASP.NET. That's not a world in which I'd spent any time, so I had underestimated its size.
Some parts of the internet (e.g., Reddit) are primarily concerned with free software and its associated languages: Perl, Python, Ruby, PHP.
Some parts (e.g., Lambda the Ultimate) are concerned with more esoteric languages: Haskell, Lisp, Joy, Coq.
Other parts (e.g., Stack Overflow) are more mainstream: Java, .NET.
You cannot draw any conclusions about the popularity of a language by sampling just one of these 'pools'.
Ruby had its moment in the sun in 2005 - 2006 when Rails was making its way through the community and Apple decided that it would package it with OS X. So to pick 2008 as the year for Ruby to gain a lot of popularity seems amiss to me.
The Ruby language itself is, as you stated, very attractive. Its syntax and OOP model are what make it a hit with developers. You get equivocally the same product as you would with another language, but with what feels like less time wasted on internals.
Rails is really what I think is holding Ruby in the mainstream right now, more or less because of its ease-of-use and database handling. Web developers love it for that.
If you really want to see sites that have a lot of Ruby(on Rails) chatter on them, you could check out http://refactormycode.com or http://pastie.org. Those websites are built on RoR and are used very frequently by Ruby(on Rails) users.
Regardless of any real numbers, one thing I do know: When I go to look for a Ruby library for something I'm working on, I find something satisfactory over 90% of the time. And for some of the remaining 10%, it isn't that hard to write something myself. I do believe that 90% figure will rise over the next few years, too.
If I get what I need, I don't really care whether PHP or Python or C# has sixty bajillion applications and libraries written for them. :)
I find Ruby very attractive in several ways, but it has some issues holding it back.
The biggest I think is that Python already covers much of the same ground, has a larger library of projects, and thusfar better performance.
The other main problem I've had is also the thing that keeps it so popular: Rails. I think there are a lot of people that don't even think of Ruby as a standalone language. While I appreciate that Rails is supposed to be pretty great, it is not anything I deal with, and thus I get annoyed at having to wade through so much discussion of Rails to find an answer to a question in Ruby as a standalone language.
One last thing that has made me skittish about it is the 'more than one way to do it' philosophy it shares with Perl. I was not a fan of that.
It is really a matter of their already being a few hammers around, and Ruby's main distinguishing feature that most people tout currently is Rails.
There's a lot of activity with Ruby in web-based development. You just have to join the right communities and lists.
I don't think it will ever be as popular as C/C++ (because of the existence of already deployed code and a developer base) or Java (because I imagine it isn't quite as easy to understand at first).
2 - Not many rubyist come here. I you look there is a TONNE of Ruby projects. Just not here so much.
Check out what is happening on Github, rubyforge etc. I mean, Rails for starters is massive.
Here's my theory:
Industry Adoption - Although ruby is used in the real world, other languages (e.g. Java, C++, C#, etc.) have been accepted as "safe languages". No one ever got fired for picking Java, or C#, but CIOs' eyebrows have been known to raise when ruby is mentioned.
Talent Pool - When selecting a language, you want to know that you can find a good pool of talent. The more popular the language, the larger the pool, and the greater number of experts (statistically) (statistics do lie 50% of the time ;) ).
My hopes:
I believe the ruby talent pool will grow over time and the productivity offered by ruby will present a huge incentive for its adoption.
More and more colleges will teach it.
Please don't take TIOBE too seriously. Checking search engines for instances of "language-name programming" as some sort of indicator of popularity isn't very meaningful.
More than likely because it is younger than a lot of other languages and, on the web side of things, isn't as easy to implement as PHP and Python. Ruby has also gained notoriety as a web scripting language due to Rails which may be turning off some developers who are looking for client-based languages to work with.
Is Ruby not popular? I think it is but it hasn't really reached a critical mass yet to be widely accepted.