Ruby

July 31, 2008

Groovy 1.5: No Private for You!

No_soup

Considering Groovy for your next big project?  We did.  All things considered, it figured to be a safe choice given its Java pedigree. From the limited exposure I'd had to Groovy up until that point, it looked and felt remarkably familiar to Ruby (a good thing).  I had even heard you could cut & paste any amount of Java into a .groovy file and it would just work.  Depending on what 'work' actually means, this is mostly true. 

One of the small untruths about Groovy behaving 'just like Java' is worth serious consideration - especially if you want your .groovy code to become API-ready.

Continue reading "Groovy 1.5: No Private for You!" »

May 31, 2008

RailsConf 2008 Saturday Night Key Note: Kent Beck

I got lazy and didn't blog about DHH's key note last night.  So, before I get on with Kent's salient story-style wisdom, I'll quickly catch up with DHH's.

Continue reading "RailsConf 2008 Saturday Night Key Note: Kent Beck" »

May 30, 2008

Summary: Dialogue Concerning the Two Chief Modeling Systems

Jim Weirich, Joe O'Brien, and Chris Nelson acted out a dialog where they built an application to reserve conference rooms.  Very entertaining and novel approach for a tech conference!  I loved it.  But, to the point now - the summary...


So, you want to build something?  

Their are at least two philosophies to fleshing out the model: Traditional object-based modeling and behavior-based modeling.  How are these different?

Continue reading "Summary: Dialogue Concerning the Two Chief Modeling Systems" »

Yellow Pages.com Rewrite

Lessons Learned:
  • Freeze existing functionality
  • Field small, co-located, talented team (4 developers)
  • Dedicate long technology evaluation, prototyping, and planning period
  • Assign technical decision maker and communicator to management
  • Leverage UX team: all page design and HTML gen, then give to dev to slice up and wire
  • Change only the obvious
  • Deploy beta frequently and actively recruit feedback  

May 29, 2008

RailsConf 2008

Rails2008_logo_conf

I'm at RailsConf.

Portland, Oregon is, well, Portland (overcast and wet). Got in late last night and walked over to Stanford's. The service was friendly, even at 10:30 PM.  Everything about the burger was above average.  And it came with hot, crispy, slightly salty fries.  It was all devoured with sips of a local wheat bear that I forget the name of.

So far, having been away from Ruby and Rails for over a year, it feels like going back to a place you used to live. Some things are still the same. In other ways, I hardly recognize the place.  New techniques like elastic computing (and plenty of competing commercial hosting options), new tools such as git, tarantula, and hobo, etc.  Good stuff.

I'll pretend I blog and let you know how it all goes.

December 28, 2006

Ruby Snippet: Shortening Long Strings For Display

Ever had a long string like this:  "myveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongstring" and wanted to turn it into something much shorter, such as this: "myveryvery...longstring"? 

Here's a little snippet that does just this.  It works great in HTML select lists which, to my knowledge, are impossible to dynamically resize as the user drags their browser window larger or smaller.

Continue reading "Ruby Snippet: Shortening Long Strings For Display" »

December 14, 2006

Resolving Files with TextMate, Subversion, and FileMerge

If you're new or semi-new to TextMate and you're collaborating with someone on the same development project, file change collisions are inevitable.  Textmate has nice support for resolving file conflicts when they show up after updating to the latest SVN depot revision.

Note: This post assumes you are on a Mac :^).

Continue reading "Resolving Files with TextMate, Subversion, and FileMerge" »

December 06, 2006

Ruby Arrays: select(), collect(), and map()

As a former Java developer and new to the concept of blocks, these API options seem perplexing at first.   They're not.  All three take a block.  How they use the block is what distinguishes them.  You should read the RDoc for yourself but, if you want a quick a dirty summary, continue reading this post.

Continue reading "Ruby Arrays: select(), collect(), and map()" »

November 22, 2006

Ruby Refactoring Pattern: "Forward with Default Params"

Introducing Ruby refactoring pattern called "Forward with Default Params."  This applies to any language that supports parameter defaulting, actually.  And, this pattern may already be documented somewhere for all I know - I haven't looked into it.  If someone can point this out, I'll be happy to defer all credit.  In the meantime...

Problem: You keep creating new methods, each calling the same helper or 'core' method (we'll call it 'method_a'), but with different params.  You can't change the required params of the core method because spagetti-legacy code relies on method_a, without params, such as with Rails controllers.  You should fix the spagetti code but time dictates otherwise.  However, you feel dirty violating DRY in your controller.  What to do?

Continue reading "Ruby Refactoring Pattern: "Forward with Default Params"" »

November 18, 2006

The Rails Edge, 2006 - Day 1

In this post and the two that follow, I highlight interesting talks at The Rails Edge, 2006.  I do it for Google searching posterity and for my admittedly selfish desire to reinforce key concepts presented. 

Continue reading "The Rails Edge, 2006 - Day 1" »