Duck A La Range

Posted by Rick DeNatale Thu, 20 Sep 2007 15:36:00 GMT

On ruby-talk, Sammy Larbi recently asked if it would make sense to add a length method to Range, something like this:
class Range
     def length
          self.end - self.begin
     end
end

This led to an interesting discussion about the varieties of ranges, and ultimately led me to this article about duck types.

Read more...

Posted in  | Tags  | 3 comments | no trackbacks

Tell us what you really think

Posted by Rick DeNatale Thu, 20 Sep 2007 13:20:00 GMT

Obie Fernandez just went off about Java vs. Ruby/Rails.

No time to comment, read it for yourself.

Posted in ,  | Tags  | 1 comment | no trackbacks

Block Your Privates!

Posted by Rick DeNatale Tue, 04 Sep 2007 15:28:00 GMT

I’ve noticed that some rubyists like to use indentation to delineate method visibility.

The first time I noticed this was when Marcel Molina Jr. used it during the charity testing workshop at the Ruby Hoedown.. I just encountered it again in at least one piece of sample code from Rob Orsini’s “Rails Cookbook.”

During the testing workshop, Chad Fowler expressed displeasure with this style, and I’ve got to agree.

Read more...

Posted in ,  | Tags ,  | 6 comments | no trackbacks

To paraphrase Kent Beck...

Posted by Rick DeNatale Sun, 02 Sep 2007 21:35:00 GMT

I’m catching up on my RSS feeds this afternoon, and I just ran across the latest from John Lam. Which exposed an interesting coincidence.

Oh yes, Merlin is the original code-name for our team, which was originally IronPython but has now expanded to include the Dynamic Language Runtime and IronRuby.
- John Lam

The codename for IBM’s original VisualAge project was “Camelot.” Various subcomponents and follow-ons were dubbed with various names from Arthurian legend. For example, there were components with names like “Lancelot” and “Guinivere.”

Sometime after the initial success of VisualAge, it was decided that IBM would actually produce a separate Smalltalk language and IDE packaging, a product which was originally named “IBM Smalltalk” at launch.

But during development IBM Smalltalk had Arthur’s wizard as its namesake. As usual there were tee shirts, and this article starts with a picture I just took of my copy of the IBM Merlin Tee, which my wife still uses as an exercise tee. And in case you can’t read them, the words in the crystal ball read “think BIG/TALK small” a combined reference to IBM, Smalltalk, and I suppose, Teddy Roosevelt. Now old Merlin might look more like a Swami than the wizard of Camelot, but here’s the proof from the front of the shirt:

So to paraphrase my old buddy Kent Beck, I knew that Microsoft was trying to implement Ruby, but I didn’t know it would be called Merlin!

Posted in , ,  | Tags ,  | no comments | no trackbacks

Werewolves of Ruby

Posted by Rick DeNatale Mon, 20 Aug 2007 20:34:00 GMT

One of the things I learned at the Ruby Hoedown, is that a sizeable number of the Ruby community who attend such conferences are into a psychological game called Werewolf.

At the hoedown various presenters, among them Marcel Molina, Jr. and Chad Fowler, repeatedly asked for a venue in which to play the game. After the contest, a group of experienced and newbie werewolves (count me amongst the latter), went to the Velvet Cloak Inn in Raleigh and spent Saturday evening trying to either hide our own lycanthropy or flush out the lycanthropes, among us.

For those planning to attend a Ruby conference for the first time, be warned, there are werewolves among us, and playing with them can be a fun experience.

Posted in  | Tags ,  | no comments | no trackbacks

Aspects of Beauty: Proportion, Integrity, Clarity, and Monkey Patching?

Posted by Rick DeNatale Mon, 20 Aug 2007 18:25:00 GMT

Besides being a master werewolf, Marcel Molina Jr. gives great presentations!

In his keynote presentation on the second day of the Ruby Hoedown, Marcel talked about “What Makes Code Beautiful”, click on the link for the confreaks video of this session.

The talk started with an exploration of the classical Philosophy of Beauty, from Plato to Descartes. Marcel summarized this by proposing that beauty lies in the balance between three aspects which, at times, either strengthen or oppose each other:

Read more...

Posted in ,  | Tags , ,  | 1 comment | no trackbacks

Ruby Hoedown TeeVee - "Hee Haw!"

Posted by Rick DeNatale Mon, 20 Aug 2007 14:13:00 GMT

I notice that master werewolves Coby Randquist and Carl Youngblood have gotten all of the videos from the inaugural Ruby Hoedown (at least in rough cut form) on their confreaks website.

I’m stoked about this, and the site in general. Like the way infoq web publishes presentations, confreaks shows synchronized live action video and the “slides”, however I like the confreaks site better.

  • The “slides” are directly captured as video from the presenters laptop. The big plus here is that live demos are also there.
  • The presentation is “widescreen” with the two components laid out side by side, which I think works better.

As for content, there was lots of good stuff at the hoedown which is now available for viewing on-line. Check it out.

Posted in  | Tags ,  | no comments | no trackbacks

After the Hoedown is Over, Part 1

Posted by Rick DeNatale Tue, 14 Aug 2007 15:03:00 GMT

The first Ruby Hoedown, sponsored by the Raleigh Ruby brigade, has finally come and gone. I had a great two days, saw some old friends, and made lots of new ones.

Here are my initial thoughts after more than a bit too litle sleep after a night trying to root out werewolves.

Read more...

Posted in , , ,  | Tags ,  | no comments | no trackbacks

Ahh, the Subtleties of Ruby's Operator Precedence

Posted by Rick DeNatale Tue, 07 Aug 2007 19:24:00 GMT

Not long ago while working on an existing Rails application, (i.e. code I hadn’t written). I was mystified when a logical expression seemed to be returning an odd result. The expression had been written with not, and, and or, and was the right hand side of an assignment statement. ventually I changed to using !, &&, and || which fixed the problem. I never completely understood what was going on, until I encountered this blog entry by Jay Fields.

One of the big differences between Ruby and Smalltalk is the use of operator precedence. In Smalltalk, the grammar is very simple, unary message selectors bind tighter than binary selectors, which bind tighter than keyword selectors. The assignment operator binds more loosely than any of these. This is often a stumbling block for newcomers to Smalltalk when they find that in Smalltalk 3 + 5 * 2 evaluates to 16.

Ruby in comparison has quite a rich and flexible syntax. Usually, it’s quite intutitive, but, depending on where you come from there can be some surprises.

I understood the relative precendences of, say && vs. and in Ruby, but the fact that and had weaker precedence than = escaped me, until Jay’s article turned the light on for me.

As they say, you learn something new everyday, or at least you hope you do. I don’t expect that I’ll forget this little corner of Ruby in future

Posted in , ,  | Tags ,  | 1 comment | 1 trackback

It Might Not be Written in Ruby but...

Posted by Rick DeNatale Fri, 03 Aug 2007 00:11:00 GMT

This looks interesting.

I wish I had a nickel for every time I’ve typed something like:

grep whatever -R . | grep -v .svn

Posted in ,  | Tags , ,  | 1 comment | no trackbacks

Older posts: 1 2 3 4 5 ... 7