Conventions Uber Alles

Posted by Rick DeNatale Tue, 11 Sep 2007 23:24:00 GMT

One of the Rails mantras is “Convention over configuration.” Today I bumped up against that one in spades.

Being an agile sort of guy, I tend to make frequent small refactorings, ofen this involves renaming things. I’m working on a project which will involve talking to a remote legacy database. I’m building migrations to set up a local development database which mirrors the schema of this database. I’d already generated a migration, and while working on it decided that it needed to be renamed. So I changed it to something like “007_create_LEG_Frammis_table.rb” since the legacy table had the name (changed to protect the guilty) of LEG_Frammis.

I was shocked when I ran rake db:migrate only to find that rake blew up. Turning on the—trace option to rake showed that it wasn’t even getting to my migration code. Instead some code in vendor/rails/activerecord/lib/active_record/migration.rb was getting an unexpected nil and trying to send the message first to it.

A quick look at the code didn’t reveal an obvious reason, so I broke out ruby-debug and ran rake under rdebug.

It turns out that rails REALLY expects migration names to match the regular expression /([0-9]+)_([_a-z0-9]*).rb/, those uppercase characters were the culprits.

Update

The patch, which Ben mentioned that he submitted in his comment, has been turned down because it would violate the assumption that round trips can be made between class names and file names.

Posted in  | 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

How to Cure The PayPal Subscription Blues

Posted by Rick DeNatale Mon, 03 Sep 2007 01:08:00 GMT

Some months back, I got the opportunity to work on an existing web site, implemented in Rails, which uses PayPal subscriptions to control access.

Since them, I’ve learned more about PayPal subscriptions than I cared to. Today’s revelation on Slashdot of the latest paypal subscription glitch prompts me to share a bit of this hard-earned knowledge. Read more...

Posted in  | Tags ,  | no 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

Nobody Could Count Beans Like IBM

Posted by Rick DeNatale Sun, 02 Sep 2007 20:52:00 GMT

In my thirty-two year career at IBM, I can’t begin to count how many times I was bothered by the IBM software development process.

When I started, in 1974, I found myself trying to swim under the waterfall. Everything hinged on “Requirements Documents,” “Initial Functional Specs,” “Design Reviews,” etc. Managers were constantly wanting line of code estimates. Far more effort was wasted on process rather than progress. Sometimes the process overhead was fatal. My first project at IBM was part of IBMs major initiative in the 1970s to replace the IBM/370 with a new system called “FS”. One of my heroes at the time was John Sowa who worked in the architecture department and whose role seemed to be the resident iconoclast. In one of his memorable memos available on his web site, John made the observation that the system architecture specification comprised fifteen registered IBM confidential documents, each with an individual need to know. A fact which effectively prevented anyone in the company from understanding the system and its problems.

So, it should be no surprise that I came to an appreciation of what are now called agile methods, early on in my career, and fought for the processes and technologies which enable agility inside IBM, and evangelized such approaches to IBM customers.

Fred George was one of my allies during part of this struggle. Fred was a middle-level IBM manager who came to the IBM lab in Cary, NC about the time we started using Smalltalk, and I was developing a prototype application development tool which morphed into VisualAge. I worked in Fred’s organization and claim influencing him on dynamic OO technology, and agile methods.

Fred now works for ThoughtWorks, and blogs about agile methods. Recently he has been writing about how to push back against bean-counting. I get the sense that Fred shared many of my frustrations with the old IBM process.

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

See You at the Hoedown?!

Posted by Rick DeNatale Tue, 07 Aug 2007 21:30:00 GMT

This weekend, the Raleigh Ruby Brigade is hosting the Ruby Hoedown, at Red Hat Headquarters in Raleigh, NC.

I’ll be there, so if you will be too, and you want to beat me up about something I’ve written here, or just want to talk, look me up.

Posted in  | Tags ,  | no comments | no trackbacks

Older posts: 1 ... 4 5 6 7 8 ... 12