agile-ajax

Rails ThreatDown!

It may help to read this one in a Stephen Colbert deadpan voice...

You want Fear, Uncertainty, and Doubt. I'm just the fuddy-duddy for the job...

This is the ThreatDown!

Threat #5: Terse Partial Declarations!

The number five threat to the Rails community this week is this commit, reducing the amount of typing it takes to invoke a partial. You can now type this:

<%= render @article %>

Instead of this:

<%= render :partial => "article", :locals => {:article => @article} %>

The old way, with it's triple repetition of "article" gave me a comforting Java feeling, making me want to go and write some strongly typed getters and setters.

The new way reduces the need for the locals -- this lack of caring for locals and local conditions can only lead to greater federal control over our templates and partials. Can the Department of Partial Partials be far behind?

As you know, I'm not a fan of unneeded, useless, content-free, windblown verbosity. In this case, though, are we not all locals? And if we don't stand up for the locals, who will stand up for us?

Threat #4: Automated Testing!

The number four threat to Rails this week is automated testing. As Jay Fields points out on his blog, testing tools across different languages suffer from a distressing lack of consistency in how they express expectations, leading to confusion on the part of test writers and maintainers.

I think there's one clear solution to this problem: abolish testing. Only by eliminating tests can we ensure perfect consistency. Only by removing expectations can we fulfill them. It's time to liberate our code from the constraints of our constraints and let it run free, without expectations or burdens, across the functionality landscape. Run free, code!

Threat #3: Rake and Generate!

Threat number three is this innocent command:

rake generate controller tasks

It sure looks like that should work, right? But no... Rake comes back to me with some guff that it doesn't "know how to build task 'generate'". Hey Rake -- how hard can it be to generate -- just look a couple of directories over to your immediate right. No, not the tmp directory, that's too far. There, the script directory.

Figure it out, Rake, just because have a temporary brain freeze doesn't mean I like to start my day with lip from a program named after a gardening implement.

Threat #2: Mythbusting!

DHH has been writing a series of blog posts busting Rails myths. This is a huge threat to the Rails community.

Look, we had a nice little gig going here -- all kinds of people were sure that Rails just wouldn't work for anything larger than a breadbox, while those of us working on Rails just sat back and giggled.

Sure, there was the occasional difficulty dealing with clients who said things like "we've heard Rails can't scale", or "is it true that Rails eats puppies?". But back then, when you found a client willing to take on Rails, that had real value.

But now, if these myths get busted, well then, anybody will be willing and able to use Rails on all sorts of projects. Who needs that kind of headache?

Threat #1: Syntactic Sugar!

Clearly, the biggest threat facing Rails this week are the methods Array#second through Array#tenth. Added to Rails core back in June, it took until this week for the shock to wear off the Rails community so that we could let our outrage be known. Show your outrage on the commit thread.

This is just another example of the programmer-coddling, readability-at-all-costs, complexity-for-the-sake-of-complexity mentality that makes Rails so much harder to use than Enterprise Java Beans.

Hey, DHH, if I wanted my programs to read like English, I'd write in AppleScript. Or Lisp. Or Wasabi, like Joel Spolsky. Or I'd just write them in English and wait for artificial intelligence to catch up.

My proposal: remove all these methods. And remove the bracket syntax. If you want a value from an array, you need to ask it politely and provide the memory address in hex. I think this will do:

array(ff98).pretty_please_with_sugar_on_top

Late breaking update: DHH has removed sixth, seventh, eighth, ninth, and tenth. He has, however, added forty_two.

(You think somebody is going to take this all seriously? Sigh.)

Topics:

Comments: 3 so far

  1. “He has, however, added forty_two.”

    I think you meant “forty_second” … which would be totally awesome.

    Comment by code_monkey_steve, Friday, November 21, 2008 @ 7:51 pm

  2. My favorite part: “Added to Rails core back in June, it took until this week for the shock to wear off”

    Hilarious.

    Comment by Mike Nicholaides, Saturday, November 22, 2008 @ 10:59 am

  3. code_monkey_steve: No, he really added “forty_two”, though I agree he probably meant to add “forty_second”.

    http://github.com/rails/rails/commit/e50530ca3ab5db53ebc74314c54b62b91b932389

    Comment by Noel Rappin, Saturday, November 22, 2008 @ 11:22 am

Leave a comment

Powered by WP Hashcash

Who is Pathfinder?

Topics

Search

WordPress

Comments about this site: info@pathf.com