January 2008 Archives

AddThis Social Bookmark Button

With the addition of Java Native Access (JNA) to JRuby, systems programmers using JRuby now have greater flexibility in terms of interfacing with underlying operating system.

Some Ruby users are familiar with the ‘Win32API’ library that ships as part of the Ruby standard library. That library lets you interface with the Windows API by defining function pointers from specific DLL’s that you later call. With JRuby’s JNA interface you can now interface with Windows in a similar fashion.

Gregory Brown

AddThis Social Bookmark Button

When I first got involved in free software development, I didn’t really know why I was doing it. It just seemed reasonably fun and challenging, which was enough to let it steal up every spare minute of my time in the form of a not-so-mini obsession. I didn’t so much think in terms of community, or how whether of my work would be useful to people, I was mostly just hacking for hack’s sake.

Eventually, I came to realize what fueled my work in open source, and that was the ability to learn from some truly amazing people, and later, return the favor by doing the same for others. If you like any of the work I’ve done in Ruby, you have exactly one person to thank for getting me started (James Edward Gray II), but hundreds to thank for keeping me going.

Here I’d like to talk a bit about my experience with the Ruby community and how it compares to something completely different, the community surrounding the board game Go. As I played in this past weekend’s North American Oza tournament, the idea for this article came to mind, and hopefully it doesn’t sound much worse in type than it did in my head. I must warn you, if you’re looking for technical depth, you’re not going to find it here, this is mostly just wishy-washy feelings and general observations that’ll only be interesting for those that have an obsession with community dynamics.

If that doesn’t scare you away, feel free to read on.

AddThis Social Bookmark Button

To ensure your test cases call efficient MySQL

  def test_my_case
    assert_efficient_sql do

      # just wrap them in this block!

    end
  end

The assertion intercepts and copies out your MySQL SELECT statements, then calls EXPLAIN on each one, and inspects the results for common problems.

The goal is test cases that resist database pessimization, even as you change your data relations, to add new features. If you run your tests after every few changes, you can easily detect which change broke your database’s indices and relations.

This article is a reference for this assertion’s options. The techniques should be ported to any database with an EXPLAIN or similar system.

Gregory Brown

AddThis Social Bookmark Button

If you don’t mind ‘bad’ language and a little bit of hate, go check out Zed Shaw’s rant,Rails is a Ghetto.

I’m not quite sure what his intent was with the article, I’m not sure that even matters. What I know is that it has shock value, it made me laugh, and that a number of things in it ring true with me, even if a bit magnified.

Zed and I have had at least a couple conversations about the Ruby / Rails communities before, and I’d say philosophically, we’re mostly on the same page. The key difference is that Zed is… umm… Zed.

One thing that he pointed out as a difference between us is that I don’t really challenge the status quo. This is true, I prefer to slowly bend the rules rather than shatter them, and see where that takes me. My response though was that I like to challenge the folks who try to suppress those who would challenge the status quo.

So here’s my challenge at a few responses, because everyone loves to stir things up!

Zed is so Ghetto:

However, such a hate-filled nasty person should not be allowed to terrorize the nice, pleasant, and generous Ruby community. Sure there are bad guys out there, there are in any community, but this type of rant is pure crap. Such arrogance and hate are self-destructive. I hope Zed’s self-destruction happens far away from my world, but I wish it would hurry up so the rest of us can get back to enjoying writing code.

Wait a second. Zed is getting in the way of you enjoying writing code? Is Zed Shaw standing there threatening Roundhouse kicks to the head while you try to type in some Ruby code?

Or is Zed distracting you because you’re reading his blog and getting offended? If so… it seems that the solution is the same as if you don’t like something on TV. Change the channel. Go outside and take a walk.

Wear some garlic, I heard Zed hates garlic. Something about how it steals his magic powers.

On a serious note though, saying that hating on people in public is self destructive is like saying that smoking crack is self-destructive. If you think that Zed doesn’t know what he’s doing, you’ve been duped.

I was going to go on and challenge a few more of Zed’s haters. But you know what, I haven’t found any. The closest thing is Giles Bowkett being concerned about how anger is bad for Zed’s heart. There was also something from a consulting company which mostly agreed with Zed’s points, with only minor disagreements.

I’m not defending Zed. As you can see from the posts, he’ll physically defend himself if need be, so he doesn’t need that. I’m also not much of a fanboy, I like mongrel but I can remember when it was just something we were chatting about and playing with at NYC.rb. Still, the real thing that I’d like to confirm here is that he has a point.

If the Ruby community starts to get up in arms when they see rants like this, that’s even more of an indication of the fact that the lines between the Ruby and Rails communities have blurred, and that we’re going to increasingly turn away our best hackers who are interested in real community, beginning a slow slip all the way to JavaOne.

The good news of course is that Technorati lists a number of links to Zed’s rant with comments like “entertaining”, “hilarious”, and other such praises. Every strong community needs heroes and anti-heroes. My question is only who will replace Zed.