First, I’d to extend a big thanks to Joe and Jim for giving me a ride to the conference today.
The two tutorials I decided to attend today were:
“The Advanced ActiveRecord Workshop” with Gregg Pollack & Jason Seifer (the Rails Envy Guys) and “The Ins and Outs of Ruby I/O” with James Edward Gray II and Gregory Brown. Both of which were excellent.
The Advanced ActiveRecord Workshop covered:
- Loading large data sets (the ‘ar-extensions’ gem helps lots).
- A gentle reminder to properly index your freakin’ database.
- How Rails optimizes multiple :includes in finds and how that goes to hell if you combine lots of :includes with :conditions
- The super awesome Named Scopes (which you need to look up right now, if you haven’t already because it’s not just about defining custom finders – it’s about defining custom finders that you can chain together and get optimized queries)
- Polymorphic Associations, Single Table Inheritance, Dirty Fields, Association Proxies, Callbacks, and creating AR plugins.
I was really impressed by the smoothness of their presentation. It was a great balance of funny/informative/challenges. The challenges were a good way to make the audience think about what had just been presented. If I had one criticism it would be that the later challenges seemed too hard for the time allowed. I found that if I made one stupid mistake (which I then had to track down) I would not finish by the time they gave out the answers. I suspect they were rushing to finish on time. Overall it was great stuff and they say that this talk was an elongated version of their recent EnvyCast on ActiveRecord so I would say that it is definitely worth your 9 bucks.
The Ins and Outs of Ruby I/O was also very informative. Since Ruby has such easy file IO it’s easy to forget about the underlining structures and the problems that can crop up. Topics include:
- The most efficient way to read in a file (generally foreach)
- Random access inside a file
-
Overcoming buffering problems with file.fsync file.flush (fsync returns nil if it doesn’t work) - A resonably through regex explanation
- A compare and contrast of how to handle unicode on Ruby 1.8 vs Ruby 1.9
- How to use Marshall or Yaml to serialize your objects.
The talk was being video taped so I assume it will show up on confreaks which, btw, is my new favorite site. You can see the whole freakin Ruby Hoedown on there. And you really should check out Rick Bradley’s “flog « Test.new” talk. He takes Flog, forks it into a new project called Flame, puts it under spec, and refactors it to be less complex (nice bit O’ irony there).
Later we had some excellent Bar-B-Q at Rudy’s and discussed how the hell the Ruby world is going to migrate from 1.8.x to 1.9. We had no good solutions. The Bar-B-Q was excellent, however, so we left in good spirits.
Tomorrow I’ll be speaking at 1:30 on “Using Metrics to Take a Hard Look at Your Code” so I’m pretty excited as this will be the first mass presentation of this talk and I think its turned out nicely.