When Rails Fails
zef.me
zef.me
Ruby is an interpreted language and can't feasibly do the red squiggle thingee, but the common errors are trivially debuggable after a few hours experience with the framework. If you see an error message talking about HommeController, you search for homme globally, find the one instance of it, fix the spelling and reload the page you were just seeing. Bam, that took you three seconds.
A statically typed language with a good IDE (yes, like Java) will find almost all these errors for you as you type (excepting config files, like you said).
Routes.rb errors 1 and 2: sorry, this is either handled in a configuration file or the database, which is loaded from an XLS file in our framework. None of this is checked.
Linking to non-existent pages: we don't actually have a URL generation helper, but if we did, it would be in the JSP and thus not subject to fast checking. Since in Java you'd be passing a string as a parameter rather than an automatically generated method, you'd get nothing useful here prior to actually clicking on the link and finding it didn't go anywhere.
Misspelling confirm: This would be caught in your JSP compile step prior to deploying the server, although you'd still waste a minute.
Mistyped property names: OH GOD do I hate this one. You'll get as far as any page done by that action without error. Then the action gets loaded and the fun begins. Typically you'll get an error telling you that a form is not defined , which is your cue that says "Check the contents of the annotations for this action, something is borked", but if you don't know that symptom or (worse) if you borked something in one of the fields where the page can still load, you'd either waste a lot of time or miss the bug entirely. (For example, in our system, one way of causing this bug would leave "name" totally unchecked but let the form submission succeed for good input. Since many of our outsourcers don't bother testing with bad input...)
Misspelled formats: We don't even have this feature. (P.S. I don't know why Rails books and tutorials always emphasize this so much, since most people don't need it. I always just delete that code from my own Rails methods.)
Botching the key to a parameters access: Since the key is a string and there is no way to tell whether Map#contains("arbitrary string") at compile time, you'll get as far as execution before seeing any error here. It will probably be a NullPointerException.
Note that very, very few software development frameworks "gracefully" handle the typo problem.
They're not, though, something constrained to Rails and I'm not sure a Rails-specific rebuttal would help all that much - the difficulty is fundamental when the language and abstractions of expression are different from and essentially unknown to the system that's actually doing the runtime error checking. Another commenter spoke of the infamous JSP stack traces. Googling 'clojure error messages' brought up a thread on this as an error message:
(ns foo.bar.baz
(use clojure.contrib.core :only seqable?))
#<CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: Boolean (NO_SOURCE_FILE:0)>None of these errors are confusing once you've been using Rails for a couple of weeks.
Rails seems to favor the approach of first reading many docs and tutorials, then working your way through a series of examples, and always doing things Just So. It's not so friendly if you decide to wing it and try things because your gut says it might just work.
The funny thing is, one of the things I like about Ruby is that it works just the opposite; it's quite easy to jump in and guess at what to before reading much documentation. You'll often be right, or you'll (mostly) figure it out pretty fast.
As you probably know, Rails is about convention over configuration. This increases the initial learning curve but speeds up development once you understand the conventions. I read Agile Web Development with Rails and was able to make it over the initial hump of "what..why is this capitalized and this plural and the singular" stage.
The rest of the universe has been using MVC for five or 6 years to do web development. Praise be to Microsoft for figuring it out.
Wasn't there just another thread about '=' vs. '==' last week?
Rails works by following conventions that feed metaprogramming and method_missing magic, and the kind of safety net which the author seems to imply is missing will just never be available in that sort of system.
I find little errors like these totally worth it because of the time I save by using rails, and after the first couple of weeks (as many have already posted) most of these are non-issues.