From: "David A. Black" Date: 2007-09-26T01:16:28+09:00 Subject: Re: Why dynamic languages for ActiveRecord..? Hi -- On Wed, 26 Sep 2007, Phlip wrote: > ypomonh wrote: > >> I'm having problems understanding why people prefer to implement the >> ActiveRecord pattern in dynamic languages. Of course it is very >> convenient if you don't have to worry about what type is your column, >> but dynamic languages are more than that. > > You are describing a "soft" language, such as Perl, JavaScript, or > some aspects of BASIC. A variable can change its type based on its > environment. > > Ruby is a strongly, dynamically typed language. Strong because nothing > ever changes its type, and dynamic because you can add features to I think there's part of a sentence missing there. I wanted to comment on the first part anyway :-) I'd say that the type of a Ruby object can change, but its class cannot. That's based on an understanding of the object's type as a kind of runtime snapshot of what the object can do and what messages it understands. This framing of it is, I believe, behind the deprecation of Kernel#type (which I think only existed in the first place because "class" was impossible to parse as a method name in some early Ruby versions). I find it a useful distinction, in part because otherwise one has to come up with yet another term to refer to the thing that can change. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!