Me
About
Gallery
Company
Girl


Projects
Ruby on Rails
Basecamp
Highrise
Backpack
Campfire
Ta-da List
Writeboard


More
Feed
Archives

March 10, 13:56

Why Rails looks so good (and why it matters)

Bill Katz is a fiction author and technologist currently busy on his new venture Writertopia. He's also very interested in the beauty of Ruby on Rails and how it relates to Paul Graham's love for LISP:

Graham talks about bottom-up design, changing the language to suit the problem. It suggests one reason why Rails looks so good compared to other web frameworks: Rails looks like souped-up Ruby and not just a bunch of classes, procedure calls, and bolted-on code.

"In Lisp, you don't just write your program down toward the language, you also build the language up toward your program," Graham wrote. "Language and program evolve together... In the end your program will look as if the language had been designed for it. And when language and program fit one another well, you end up with code which is clear, small, and efficient." That's a pretty good description from 1993 on Rails development and points to a not-so-subtle difference between the web frameworks.

This is with out a doubt one of the Ruby features that excites me the most. The ability to evolve your own dialect of the language to fit the domain. The purity and beauty in code like the following is intensely satisfying (this is not pseudo code, it's fully executable without a precompiling code generation phase):

  class Project < ActiveRecord::Base
    belongs_to              :portfolio
    has_one                 :project_manager
    has_many                :milestones
    has_and_belongs_to_many :categories
 
    validates_presence_of   :name, :description
    validates_acceptance_of :non_disclosure_agreement
    validates_uniqueness_of :key
  end

Which is also why calling glue kits like Trails a clone of Rails in Java just makes no sense (and exposes the sender of such a statement as uninformed at best). Replicating a single feature of Rails, such as Trails does with Scaffolding, does not a clone make. Not only is it a pick on one of the most shallow features of Rails, but it also possesses none of the elegance. Katz addresses this with:

When answering the question "Could Rails be built without Ruby?", I think you have to address not only the functionality but the aesthetics as well. It's more than the simple lines-of-code metric. It's whether you've built a language up towards a Rails language that solves problems common in web development. As Graham points out, you could build Rails out of any language that's Turing-equivalent; the real question is in your quest to duplicate the aesthetics, whether you'd wind up doing a back-door implementation of a Ruby interpreter in the process.

When Bill Katz calls Rails "...a work of art in progress", I can definitely imagine Serious Developers tuning out: "Code is not supposed to be artistic, just functional". To me that's a terribly depressing statement. Code that can be both "art" (as defined by striving for elegance and readability as primary motivation factors) and functional is what makes programming interesting to me.

Oliver Steele from Lazlo touched on many of the same issues.


Challenge by on March 10, 14:13

I understand your passion for Ruby but please don't play "its like Lisp" card. Ruby is to (Common) Lisp what ANSI C is to Ruby.

Challenge by on March 10, 14:29

Of course, the discussion of DSLs vs. libraries are as old as Lisp and still not settled. Whether some random "technologist" likes the concept of Rails' DSL is complete uninteresting. What matters is whether real programmers will like it enough to try it.

Rails is great, but it would be nice to cut down on the hand-waving and focus on practical issues.

Challenge by David Heinemeier Hansson on March 10, 14:30

I don't know Lisp nearly well enough to make such a statement. I'm merely saying that "In the end your program will look as if the language had been designed for it. And when language and program fit one another well, you end up with code which is clear, small, and efficient" describes accurately how I feel developing in Ruby.

Challenge by Mark Windholtz on March 10, 15:10


calling glue kits like Trails a clone of Rails in Java
just makes no sense
(and exposes the sender of such a statement
as uninformed at best).

I've never heard the Trails folks call Trails a 'clone'
In most cases, they've been careful to state that Trails is "inspired by Rails (and naked objects)".
I'm amazed and excited about Rails.
But for clients insisting on the baggage of Java,
Trails may be a nice fit, and I wish them well in continuing to evolve it to the limits of Java's potential.
Go Rails! Go Trails!

Challenge by Chris Nelson on March 10, 16:28

That is a lovely code example, and you're absolutely right that it is quite impossible to do in Java.

However, for the record, Trails does not even do scaffolding, we start with the object model. And I certainly never claimed Trails to be a clone or port of Rails, not really sure how you picked that up exactly. The bottom line: if you're in a position where Ruby is the best fit for your environment, Rails is an awesome tool. If Java is the choice, I hope to evolve Trails into a productive solution, one that learns as much as possible from excellent frameworks like Rails.

Challenge by Peter Fitzgibbons on March 10, 16:52

I love your validates_... methods!. Where can I read more on how to extend the base class, and also how you define/use your validates_...?
Thanks.

Challenge by Bill Katz on March 10, 18:09

"Whether some random "technologist" likes the concept of Rails' DSL is complete uninteresting. What matters is whether real programmers will like it enough to try it."

I didn't know I had to roll out my comp-sci work at Stanford, ACM programming contests, or decades of coding to make a comment on language elegance. If you think elegance of solution isn't a "practical issue," particularly when it can be achieved without analysis paralysis, then that might reflect more on your programming background than mine.

Challenge by Bill Katz on March 10, 18:37

Ruby is to (Common) Lisp what ANSI C is to Ruby.

I wonder how many Lisp hackers would agree with that statement? Ruby and Lisp aren't going to be confused with each other, but Graham does suggest it's similar to pre-CL forms of Lisp: "If you'd shown people Ruby in 1975 and described it as a dialect of Lisp with syntax, no one would have argued with you."

Don't interpret this as a language war. It's not. But suggesting the difference is the same as between ANSI C and Ruby is hyberbole. If you could back it up with an aspect of CL that gives you that impression, I'd like to hear it because dynamic typing, OO, closures, etc. are pretty big jumps from C to Ruby.

Challenge by on March 10, 20:33

OO in Ruby is part of langauage specification.
OO in Common Lisp is a library.
Big difference.

Challenge by on March 10, 21:19

If OO is in language instead of library, how does that change the power of the language? I don't think the point is the amount of syntax, it's the difference in power and the elegance of using that power. Ruby and Lisp are more alike than C in that respect.

Challenge by . on March 11, 7:16

"OO in Common Lisp is a library.
Big difference."

It's fun to make up things and pretend they're true! Look at Santa Claus and the Easter Bunny!

OO in Common Lisp is part of the ANSI standard specifying Common Lisp. Implementation should not be part of the language spec, so if it's a library, hey, C++ was a preprocessor hack.

Challenge by . on March 11, 16:29

whatsoever ... here are a couple of things to consider..

Which language came with all these sweet features (and ideas) ... ? and continued to stay a powerfull tool in terms of features (let alone the syntax - which needs another thread) ...?

do not forget that *Matz* was (and still) a lisp lover !!!

if you can twist your mind around lisp, then its not hard to do so with ruby... !

but finally (wether you like lisp or ruby) ... select the one which makes your development fun ... (be it ruby or lisp) ... !! at the end you are spending money and/or time for the goal not the tool

Challenge by Paul on March 17, 17:19

Being a Java programmer by trade, I had to go look at Trails and was amused when I found this website:

http://www.railtrails.org/

*Chuckle*

Challenge by /_ on March 24, 2:20

CLOS, the Common Lisp Object System, is a very nice implementation of the OO model. It has a somehow different approach than other OO implementations: methods do not belong to objects, they are chosen by a generic dispatch. Most Common Lisp implementations also follow the Meta Object Protocol. The MOP lets you control and change the way CLOS works. You could implement your own OO model using the MOP.

Add macros, of course. You don't miss them perhaps, if you don't know what macros are (they are much more than just textual substitutions, because they can completely control the evaluation of arguments). You can use them for nice tricks, like shifting computation to compile time or intentional variable capture.

If you really want to pull the language up to your problem, you'r going to use macros. You need a language that supports multiple computation models. There is no language that supports *all* computation models (Lisp doesn't have native concurrency for example), but it's fun to use a language that supports more than one.
I like multiparadigm languages like Lisp or Oz. Ruby is a single paradigm language. But it's cool. It's fun. The only thing that bothers me: I really don't know why I like it. That's the way seduction works, I gues...

Challenge by nelly on June 04, 12:00

Hi. This is my links.
mature ladies in lingerie south indian mature women mature amature mature amature mature nud3 pics free naked older women older women and younger men south indian mature women mature nud3 pics mature nud3 pics mature nudists photos lyrics to older country songs mature ladies in lingerie older women and younger men mature living mature video classic mature south indian mature women older s3xy women mature living older s3xy women mature nud3 pics mature gallerys mature gallerys mature amature classic mature lyrics to older country songs mature video classic mature older moms mature anal mature nud3 pics free thumbnail pictures of older women lyrics to older country songs classic mature classic mature mature anal mature bitches nud3 senior women mature living

Challenge by mikle on June 05, 5:29

Hello. I am new here. It is very interesting.
girls in body stockings pantyhose crossed legs cum on panties pantyhose crossed legs girls in fishnet stockings pantyhose and nylon feet and toes pictures of crossed nylon legs feet in nylon pictures of crossed nylon legs mature pantyhose pictures free panty thumbnail gallery pantyhose mpeg pantyhose crossed legs boys in pantyhose pictures of crossed nylon legs girls in body stockings pantyhose crossed legs men who wear pantyhose pantyhose and nylon feet and toes feet in nylon pantyhose crossed legs pictures of crossed nylon legs girl panty pics men pantyhose pantyhose and nylon feet and toes nylon stocking galleries girls in body stockings russian pantyhose women men who wear pantyhose russian pantyhose women girls in body stockings feet in pantyhose pics men who wear pantyhose men pantyhose free pantyhose thumbs mature pantyhose pictures russian pantyhose women feet in pantyhose pics nylon galleries feet in nylon

Challenge by petra on June 05, 9:18

Hi. This is my links.
creampie movie interracial wives bareback creampies free creampie s3x free creampie pics free latina creampie amature creampies latina creampie free creampie pics free creampie p0Rn creampie cum and amature creampie movie pictures creampie free creampie clips creampie p0Rn latina creampie gangbang creampies videos asian creampies latina creampie pictures creampie interracial wives bareback creampies free creampie pics and stories creampie pic creampie p0Rn asian creampies creampie anal creampie anal creampie movie creampie pussies free creampie pics and stories free creampie s3x creampie p0Rn creampie internal, cumshots free creampie clips creampie pic asian creampies creampie pussies free creampie pics free pictures creampie creampie pussies free creampie pics free

Challenge by abay on June 05, 17:24

Hi. This is my links.
older thumbs free older women mature amateur older thumbs mature men galleries mature amateur mature babes free older women free mature free mature p0Rn free mature mature women t9p older men younger women mature babes mature asian mature men galleries older thumbs mature amateur older women younger men free older women mature wives mature 1esbians free mature mature babes mature amateur old naked women free mature s3x free mature s3x mature wives mature women in stockings mature asian mature 1esbians mature asian mature women t9p mature amateur mature asian mature babes older thumbs mature wives mature women in stockings

Challenge by angel on June 05, 21:24

Hi. This is my links.
panty fetish pantyhose links.com mature ladies in pantyhose men caught wearing pantyhose pictures of men wearing pantyhose used pantyhose used pantyhose leggs pantyhose satin panty galleries satin panty galleries used pantyhose mature pantyhose pics young teens in bra panties young girls in panties mature ladies in pantyhose young teens in bra panties young teens in bra panties free panty movies satin panty galleries pantyhose links.com free panty movies mature ladies in pantyhose young teens in bra panties satin panty galleries teens in panties free links free pantyhose thumb galleries young teens in bra panties young girls in panties pictures of men in pantyhose leggs pantyhose leggs pantyhose used pantyhose leggs pantyhose free panty movies panty fetish free panty movies pictures of men wearing pantyhose used pantyhose satin panty galleries leggs pantyhose

Challenge by angel on June 06, 11:49

Hi. This is my links.
older 1esbians mature women over 40 mature women over 40 older women stories mature big tits mature nudists older black women mature asian women mature asian women mature hardcore links mature hardcore links mature big tits mature mistress mature nudists older holland mature glamour black older ladies older holland mature hardcore links mature glamour young girls older men older women stories thumbs gallery older women black older ladies mature nudists mature pic gallery mature asian women mature glamour how to meet older women older women stories free older women galleries mature asian women black older ladies how to meet older women young girls older men mature pantyhose pictures older black women free older women galleries mature hardcore links older holland

Challenge by atmor on June 08, 0:26

Sorry for my links
mature pantyhose pics mature women in pantyhose free wet panty pantyhose images men caught wearing pantyhose men caught wearing pantyhose wet pantyhose satin panty galleries men caught wearing pantyhose panty post white pantyhose cheerleader panty pics men's pantyhose panty fetish free teen panties white pantyhose winnie-cooper pantyhose men caught wearing pantyhose cheerleader panty pics office girls in nylons satin panty galleries wet pantyhose mature women in pantyhose mature ladies in pantyhose satin panty galleries office girls in nylons pantyhose images white pantyhose hooters girls in pantyhose mature pantyhose pics white pantyhose panty fetish office girls in nylons satin panty galleries free wet panty free teen panties cheerleader panty pics free wet panty celebrities in pantyhose free wet panty

Challenge by alex on June 08, 4:20

Sorry for my links
pantyhose men teen panty pictures silkies pantyhose free pantyhose sites pantyhose fetish shiny pantyhose little school girls panties shiny pantyhose little school girls panties panty line pics free pantyhose sites men in panty pics teens in pantyhose mature women in nylons free pantyhose sites pantyhose men pantyhose men little school girls panties pantyhose pic gallery pantyhose foot gallery men in panty pics crotchless pantyhose crotchless pantyhose bra and panty pics shiny pantyhose free pantyhose sites pantyhose pic gallery teen panty pictures shiny pantyhose mature women in nylons teens in pantyhose wolford pantyhose silkies pantyhose free pantyhose pics shiny pantyhose panty girls pantyhose men panty line pics crotchless pantyhose shiny pantyhose

Challenge by george on June 08, 19:26

Hello. I am new here. It is very interesting.
mature cart00ns s3xy mature women older women pictures daily mature boobs free mature s3x pics mature cart00ns mature s3x pics daily mature boobs free mature s3x pics daily mature boobs meet older women older women pictures mature personals mature older t9p older pussy top mature t9p's mature personals mature content mature cart00ns mature personals daily mature boobs mature older t9p mature s3x pics bcn mature mature older t9p free pics mature ladies meet older women free mature movies mature 1esbian mature cart00ns bcn mature s3xy mature women free pics mature ladies free mature s3x pics mature 1esbian older pussy daily mature boobs mature cart00ns older pussy older pussy