Rails 3 Has Great Documentation
weblog.rubyonrails.org
weblog.rubyonrails.org
I started with railsapi.com - selected something at random: first ActionView::Layouts (seems like a crucial class):
find_layout(layout) - This is the method which actually
finds the layout using details in the lookup context
object. If no layout is found, it checks if at least a
layout with the given name exists across all details
before raising the error."
Right... where does the "lookup context" object go? What is "layout" What's returned? Where does it "find the layout"? Why does this method exist? What error is raised? Ok - maybe I just chose something that's not popular - another try is ActionView::PathResolver: to_path() - Alias for to_s
to_s() - This method is also aliased as to_path
You're kidding me, right? Ok - something easy this time - "Float" -> "round(precision = nil) - Rounds the float with the specified precision." Rounds which way? What type of rounding is used? How does it behave for infinities and -epsilon? Something important "I18n" - there is NO documentation at all.I checked APIdock, thinking it might be better - it took a lot of clicking to get to a class which had any documentation at all (ActiveRecord in this case). If you check "browse", you'll see yourself how many classes lack any kind of description...
Summing up - I'm not sure about the screencasts, guides, etc., but API docs are almost non-existent.
Rails API documentation is far from perfect, but a surprising amount of the important stuff is covered in a few consolidated locations. The documentation for some modules is often consolidated in a more central location so you can get a better overview of the whole API. See ActionController::Base, ActiveRecord::Base, ActiveRecord::Associations::ClassMethods for example. As for I18n, well, I18n is an external gem, it is not core to Rails which is why it is not documented there.
No one is arguing that Rails API documentation is newbie friendly, but I would argue that the purpose of API documentation is not to introduce people to the framework; it's reference material. The Rails Guides are pretty good (if not lagging a bit for some aspects of Rails 3) and I would put them up against any other framework documentation I've used.
Being able to look at a function, have clear documentation WITH EXAMPLES was brilliant -- being able to see some of the common questions and resolutions from users was exemplary.
I know that the python docs are largely considered aces, but I have yet to see a language reference as good as the PHP documents. I hate the language, but it was the first language I could actually learn from its own documentation.
Here you go:
http://www.lispworks.com/documentation/HyperSpec/Front/index...
I've seen this (similarly highly-voted) comment made elsewhere. I just don't get it.
The PHP docs are often woefully incomplete in their explanation of functions. The user-submitted comments are the blind leading the lame, often containing competing solutions to the same problems, all of which are incomplete and poorly documented.
Aside from several highly-voted comments in discussions, though, the PHP documentation doesn't seem to be a frequently cited example of quality. I find that strange.
Programming tool that have the best documentation, to me, is jQuery. I think it's even better than php.net
The mere existence of documentation doesn't make it great.
http://guides.rubyonrails.org is the equivalent of the Python documentation you point to for Rails.
If you want Ruby-specific documentation, there are versions of the Pickaxe book online (http://phrogz.net/programmingruby/). Admittedly old versions, but well organised by-topic nonetheless.
Just start with Rails Guides (http://guides.rubyonrails.org/). When you are somewhat familiar you can find details in the API docs (http://api.rubyonrails.org/).
One thing though, we're comparing apples and oranges; the docs for a web framework vs the docs for a standard library. Are the django docs similar to the standard lib docs?
I'm not trying to dis python, I really like python and use it whenever I need to do mathy stuff with numpy and scipy. Most other things I do in ruby.
The documentation for Ruby itself doesn't appear to be much different then Rails, http://www.ruby-doc.org/stdlib/ difficult to read and follow.
I've never needed a "cookbook" for Python, because the ingredients are clearly labeled and arranged and I'm already an experienced chef.
Similarly when you look at this post you see that rails has "great" documentation through the means of a large amount of differing non-central sites that require some effort to go about finding as well as navigating. Though it is much better than when rails was still young.
There have been tons of Ruby documentation sites over the years and if all that effort had been put into developing a good system for the "official" documentation, it'd probably the best of any language ;-) But Ruby is very "long tail" when it comes to deciding what sites to read, mailing lists to use, etc. There are few de facto points of congregation.
That said, I'm not criticizing, because I'm the same (I want to run my own gigs, not fit in with someone else's system) and that's what I like about Ruby and Rubyists. You don't get a single "official" book of documentation about math, architecture, or English language syntax. Instead, everyone releases their own attempts and a wide variety of viewpoints and coverage is available.
In this way, Ruby feels more like a discipline or "way" of doing things than a single, specified entity that can be centrally documented well.
(I'm talking from a Ruby POV rather than a Rails one, since you brought up Ruby specifically in comparison to Python. Rails has a much more bureaucratic and centralized community than Ruby does. Rails' official documentation is also miles ahead of Ruby's.)
While your other points still stand, there is quite a bit of central documentation, and it's mentioned in the article. The fact that there's also a ton of extra documentation that other people have done in other places is just icing on the cake.
I find that page (docs.python.org) easy to navigate using the side menu and the structure of the document the fact that it is so big doesn't quite bother me, I already know most of what I need on that page and wouldn't be upset navigating it if I had to.
The formatting within the python docs is also highly inconsistent. Why (on the built-in types page) do the operations on sequence types (5.6) get a nice table, but the operations on sets (5.7) have a poorly formatted list?
[1] http://ruby-doc.org/core/classes/String.html
[2] http://cupi2.uniandes.edu.co/site/images/recursos/javadoc/j2...
I have on my recklessly large to-do list plans to update the API docs on ruby-doc.org with YARD.
The template seems a bit easier to navigate and the overall results better. But I'm always open to concrete suggestions.
[note: I run ruby-doc.org]
It's this comprehensiveness of the documentation that has impressed me before when I've needed to look things up about Python, and was enlightened about things I didn't expect to be.
There's a bit of serendipity in a big page like that, where you can learn more than you expected. But it comes at the cost of distracting you from whatever it was you came to find.
Back then I always hoped for the single page, because I was beginning with the language and jumping up and down the toc table of the docu page to figure stuff out. For a beginner, having this possibility to switch from birds to frog perspective inside one page is really great. They could do a better job on integrating the page-internal toc navigation though.
Most people who complain about the Rails documentations site probably don't use Rails everyday since it's hard to appreciate something if you don't use it.
I'm working with Rails almost everyday, and so far I enjoy it very much. The documentations are great, the Rails Guide is great (and very, very thorough and approachable), and the community is really active. As DHH said, all the arguments don't matter much once you start using Rails, since everything will all make sense (I believe this was in Rails keynote in 2009, he was referring to the debates between implementing .first, .second to the Array class, and he pointed out that these decisions were made to help developers think better and more expressive in their code and thus become happier -- and he's totally right!)
For someone who has not used Ruby before, it will likely take years to go from 0 to Ruby/Rails "Zen Master". The Ruby language seems simple at first but there are many nuances and powerful methods (such as #inject and #map) that few will master right away.
Also with regards to Rails, there are a lot of "moving parts". Randomly picking something out of the API and expecting to understand it, outside of its context etc., is not the right way to go about this.
Having been learning and working with Rails for several years now, I can tell you that there is must more excellent content now than ever before. And there will soon be plenty of Rails 3 specific books available too.