Gregory Brown

AddThis Social Bookmark Button

I’m happy to announce that the Prawn PDF library has hit another milestone on the Ruby Mendicant project roadmap. This time we’ll look at Prawn’s shiny new table drawing support, as well as some of the other features that have been added over the last several weeks. We’ll also look at where things are headed in the future, including when to expect a first gem release. All this and more lies just beyond the cut…

Gregory Brown

AddThis Social Bookmark Button

Continuing on a theme, this post brings you the latest news from Prawn, the Ruby PDF library currently being developed under the auspices of the Ruby Mendicant project. The news this time around focuses on m17n progress, TTF font embedding, and some new goodies from contributors. Sexy screenshots and code samples lie just beyond the cut for those who wish to learn more.

Gregory Brown

AddThis Social Bookmark Button

I really like the open command on OS X, but I was too lazy to look for its Linux equivalent.

Actually, my solution probably took less time than sifting through a google search:

system(case ARGV[0]
when /\.pdf/
“epdfview”
when /\.html/
“firefox”
when /\.(rb)|(pl)|(pm)/
“vim”
end + ” #{ARGV[0]}”)

Anyone else have fun little hacks they want to share?

Gregory Brown

AddThis Social Bookmark Button

Several weeks ago I wrote about the first development checkpoint for Prawn, the PDF library currently being developed for the Ruby Mendicant project. I’ve finally reached the second checkpoint, which involves basic text rendering operations, and this post describes these new features, the problems I have run into, and the plans for the coming weeks. If you’re following the project, please read on.

AddThis Social Bookmark Button

One of the rather unique features of the Fortress1 programming language is that it has builtin support for Unicode operators. For example, instead of using “==” you would use U+2261. After reading the spec, and a recent thread on ruby-core, I’ve been wondering something . Are language designers too limited in their decisions about syntax because of the limitations of the QWERTY2 keyboard?

Gregory Brown

AddThis Social Bookmark Button

Back in March, I announced the Ruby Mendicant project after several readers of this blog encouraged me to pursue the idea. For those who didn’t see the follow up details elsewhere, here’s the readers digest version:

Thanks to 70 donors, and donation matching from Ruby Central, Inc. and MountainWest Ruby LLC, I am now able to take 22 weeks off from my commercial work to focus on open source development in Ruby. I had a number of project ideas, but the general consensus is that my time would be best spent building a fast, sleek, and simple PDF library for Ruby. I’ve decided to call this library Prawn, for the time being.

Since I have just reached my first checkpoint on the project, I figured I’d give folks an update on where things are.

Gregory Brown

AddThis Social Bookmark Button

While working on Prawn, I ran into this (not-so) fun little gotcha:

>> 1.to_sym
=> nil
>> 101241.to_sym
=> nil

Anyone cool enough to tell me what this feature is all about?

Update:

I guess it isn’t totally clear what I was asking here. I’m not actually trying to convert integers to Symbols. In fact, my specs were failing because I expected some_number.respond_to?(:to_sym) to be false!

As it turns out, Fixnum#to_sym does have a purpose, but it is quite different than something like String#to_sym.

>> :foo.to_i
=> 14369
>> 14369.to_sym
=> :foo

I knew about the existence of #id2name and it didn’t surprise me much, given the way Symbol objects are implemented. Still, for the folks who keep reminding me about what Symbol objects are, please save your comments because that’s not the point here.

The point is that when I see “foo”, I can easily say. Oh… “foo”.to_sym will give me :foo.
When I see [16393, 16401, 16409], I don’t think “Gee… that must be: [:cat, :monkey, :tomato], I just need to map it with to_sym”.

So what this boils down to is an API clarity thing. Even if a Symbol is closely bound to an integer implementation-wise, I think it’s a bit of a flaw to assume that to be important conceptually. Among our readers, has anyone used Fixnum#to_sym in real code? I’d be very interested in seeing a common use case for this feature. If there isn’t one, maybe a less ambiguous name, such as id2sym might be more appropriate.

What’s more, even with the existing name, it’d be nice if some_number_that_has_no_symbol.to_sym would blow up with an error rather than return nil.

Sorry for the earlier confusion, hopefully this update clarifies that I was talking about a design peculiarity., and not some burning desire to get myself back a :1.

Tim O

AddThis Social Bookmark Button

Sorry, it isn’t entirely Ruby related… it is Python Django to be specific, but it is a message aimed at you (”the wiki-worker types”) from Lawrence Lessig recruiting people to tag members of Congress at Change-Congress.org:

Today we’re launching the second stage of our project. We’re asking wiki-worker-types (and that includes you) to help us tag all candidates and Members of Congress, by tracking for each whether they support the planks of reform in the Change Congress movement or not. We’ve built a set of tools that you can use to document — for each plank of reform — whether a candidate supports that plank or not. After that information is verified by a volunteer administrator, we’ll add it to a map of reform that we’re building. After we’re done, we’ll have a picture of the level of support for fundamental reform of Congress. And with that map, we’ll launch stage 3 of our project — raising money to support candidates who support reform

Django has the edge in the civic-Web20-computing space as Holovaty’s Django was always more focused on the public square from the beginning. You would think Rails would be a no brainer for this, but in my brief encounter with the world of political web sites, many of the people I was talking to thought that PHP was king (ick). (In related news, this is the best online book interface I’ve seen yet.)

Tim O

AddThis Social Bookmark Button

I’m sure you don’t believe it, doesn’t seem like NetBeans is going to take the Ruby developer world by storm, but Sun seems to be pouring money into Ruby support. I’m skeptical that the Ruby community is going to embrace Netbeans, but in this entry, I present some hints that NetBeans may be well on its way to becoming the Ruby IDE of choice. The idea that an IDE traditionally associated with Java development is going to take the Ruby world by storm might seem insane at first glance, but read on…

Eric Berry

AddThis Social Bookmark Button

The long-awaited mod_rails for apache was released yesterday by Phusion, a Netherlands based IT company. As many of you have already done, I hopped on board to see how it worked and was amazed on how easy it was to get up and going.

Ryan Bates, a guy whose voice many of us Rails coders have grown to know and love, assisted the Phusion team in creating a short screencast on how to install Passenger onto your Mac.

It was basically 3 steps:

1. Install the RubyGem
2. Run the passenger installer script
3. Modify your apache conf file to include the new virtual host

Can it really get easier than that? I submit that it can not.

In my opinion, Passenger is filling a void that has haunted the Ruby on Rails community for some time. Matz is quoted as saying “It is often said that Rails is weak on deployment; PHP runs fairly fast just by uploading scripts. Rails is slow on development mode, and requires restarting on production mode (and bit complex to configure). modrails might be the answer for it.”.

To get Passenger, go to http://www.modrails.com

Gregory Brown

AddThis Social Bookmark Button

Reposting from the official announcement on RubyTalk

Gobi version 1.0.0 has been released!

* http://gobi.stonecode.org
* http://metametta.blogspot.com
* gregory.t.brown@gmail.com

I am happy to announce the first release of my new fork of Ruby called
Gobi. The goal of Gobi is to implement features that I have noticed to
be completely missing.

For example, Ruby’s standard library does not even implement a
datastructure that can easily represent a Go board. Gobi has this
built in as an NArray based, highly efficient structure:

 >> x = Goban.new
 >> x.place_stone(:black, :at => "a4")
 >> x.place_stone(:white, :at => "c16")
 >> x.place_stone(:black, :at => "a4")
 StoneCollisionError: There is already a stone at a4.
   from (irb):3 in `place_stone`
   from (irb):6

As you can see from the example above, Gobi is very friendly to those
writing computer Go applications. For those wishing to write AI bots
to play the game, Gobi also goes through a lot of effort to make Ruby
more efficient.

A major improvement in performance was gained through the removal of
automatic garbage collection. This means that programmers need to be
sure to clean up after themselves, but any Rubyist who also has an
interest in Go will surely be sufficiently skilled to design programs
that avoid memory leaks.

The implementation of object destructors in Gobi is simple, due to the
addition of a release_resources hook in Object. A delete keyword has
also been added, which will explicitly start up the garbage collection
process.

Here’s an example of manual garbage collection in Gobi:

 class Foo
   def initialize
     @board = Goban.new
   end
   def release_resources
     delete @board
   end
 end

Please keep in mind that although the built in classes all have
sensible release_resources implementations, that if you’re feeling
adventurous, you can of course override them. A current fun game in
Gobi is to run a stopwatch and see how quickly memory runs out when
you write some code like this:

 class String
   def release_resources; end
 end
 string = 'a'
 1_000_000_000.times do
   string = string.succ
 end

Of course, though humorous, this should serve as a warning to you: Be
sure to properly discard your objects!

This announcement just scratches the tip of the iceberg of what Gobi offers.

Other cool features include:

- The removal of Ruby 1.9’s giant interpreter lock, as Go programs
tend to benefit from the power of true concurrency. (Unfortunately,
these patches are very platform dependent)

- A major reshifting of Ruby’s standard library. Things like option
parsing, zlib support, and fileutils aren’t really that useful for
programming computer Go applications, so they have been removed. Many
new libraries have been added, including an SGF analysis tool and a
GTP network implementation.

- An interface to a special (Proverb Semantics Parsing) PSP tool,
which allows you to train Go playing robots by simply reminding them
of proverbs such as “Hane at the head of two stones”, and “The empty
triangle is bad”, rather than resorting to low level, complicated AI
programming. This system can be used via irb while a game is under
review in Gobi’s built in Tk based SGF editor. Gobi shows that by
mindlessly memorizing proverbs, Go playing bots can decrease their
rank by two stones in half the time that an average human can.

- The removal of all lesser data structures such as the Array, the
Hash, and the Set. In Gobi, all of these structures could trivially
be built as a subclass of the Goban, so there is no need to keep them
around.

Though I will be taking off 6 months from Gobi development to work on
the Ruby Mendicant project, I hope that people enjoy this early
experimental release and that soon Ruby will be free from the core
team’s shackles to do what it truly deserves to: Reach 30 kyu on KGS
with a Gobi based bot!

Though only time will tell, I am considering reworking Gobi to fork
Aaron Patterson’s excellent Brobinius implementation, as Gobi deserves
some high quality Grosenbach screencasts.

* http://gobi.stonecode.org
* http://metametta.blogspot.com
* gregory.t.brown@gmail.com

AddThis Social Bookmark Button

CruiseControl.rb, by ThoughtWorks, is an elegant Continuous Integration dashboard for Ruby projects. This article shows how to call the RoR command “rake stats” once per build, capture the results, and chart them to track trends over time.

Our goal is this chart:

cc_gnuplot.png
Gregory Brown

AddThis Social Bookmark Button

Though I’m typing this from a Mac right now, I’m hardly a fan boy. I spend a little less than half of my time on OS X, the rest spent on cheap PC hardware and ArchLinux, and honestly, I’m happy with both (each for different reasons)

Still, Apple definitely got some things right, and not the least of which was hiring Laurent Sansonetti. He’s the guy who’s been working on cool projects such as RubyCocoa and RubyOSA, and now has just released MacRuby.

MacRuby sounds cool:

MacRuby is a version of Ruby that runs on top of Objective-C. More precisely, MacRuby is currently a port of the Ruby 1.9 implementation for the Objective-C runtime and garbage collector.

Though I’m not actively doing Mac specific Ruby development, that doesn’t mean I can’t extend thanks to a very cool hacker who has been dropping cool free software projects on our community like it was his job…. oh wait… it is. :)

Thanks Laurent for your contributions! You’re one of the reasons why the Ruby community rocks.

Gregory Brown

AddThis Social Bookmark Button

When I wrote the post I’d love to quit my job! (sort of), I was mainly aiming to start a conversation.

Still, enough people took me seriously, and now I can announce that the project is officially under way. I’m in the fund raising stages to collect $8000 so that I can take off 6 months of work to focus on important Ruby open source projects. That sounds even lower than my initial estimate, and the reason for that is because Ruby Central, Inc. decided to back the project! Here’s their press release:

RUBY CENTRAL, INC. WILL MATCH FUNDS DONATED TO GREG BROWN,
UP TO A TOTAL OF $5,000

Ruby Central is always on the lookout for interesting ways to help and
support the Ruby community, and Greg Brown has provided us with one.

Greg has announced a unique plan for himself. You can see the whole plan at
http://rubymendicant.wikidot.com/proposal; meanwhile, here’s Greg’s capsule
summary of the idea:

** Through the donations of community members, I would like to put my
commercial and personal software projects on the back burner for a
prolonged period of time (3-6 months), and focus on working on open
source projects that are of high importance to the majority of
Rubyists. **

Greg has already started to receive donations. And now, Ruby Central
is coming on board to help Greg with matching funds.

Ruby Central will match gross donations to Greg, dollar for dollar, up
to $5000 (five thousand) dollars. That means that if you donate $50 to
Greg’s effort, we’ll donate $50. We’ll stick to the same timeline that Greg
has set for himself (see the above URL).

It’s not quite like anything we’ve done before, but it sounds like a good idea
at the right time, and we’re happy to support Greg’s unusual and imaginative
endeavor.

Please keep in mind that donations to Greg are not donations to Ruby
Central, and therefore do not fall under our tax-exempt status.

Ruby Central, Inc. is a 501(c)(3) tax-exempt organization, chartered to
support Ruby-related events and initiatives that benefit the Ruby community.

Peter Cooper has also decided to support the project by both donating, and posting a summary on Ruby Inside. He does a good job of covering the whole of the story, including relating to those who feel uncomfortable supporting such an effort. I totally understand people’s skepticism, and thats why I encourage people to come talk on the RubyMendicant google group if they have any doubts about the project they want cleared up. The explicit timeline for this project and the fact that I’ve promised to record public hours will hopefully put some folks minds at ease.

Peter mentions that I talked about working on PDF::Writer or Ruport, but this doesn’t really fully explain what I was thinking of doing. With respect to PDF::Writer, I was pondering a from scratch rewrite with a sexy API and less performance problems. With Ruport, I was going to work on 1.9 compatibility for all of its dependencies across ruport-util and acts_as_reportable. Though I haven’t checked in with the maintainers of these libraries yet, it’s truly a laundry list of general purpose gems I’d be working to update. Here are just a few:

  • RubyDBI
  • Gruff
  • Scruffy
  • PDF::Writer
  • transaction-simple
  • roo
  • rubyzip

Outside of Ruport, there are lots of libraries that I’d like to see working on 1.9, and with enough time, I could work on porting them.

The ideas list will be open for suggestions until April 1st when the donations close, the goal is to focus on things that might be hard to reach from traditional open source work that is done in people’s spare time or as part of a commercial project.

Anyway, this is going to be my last mooching attempt on the O’Reilly blog for this project. If you’ve read through the proposal I’ve put together and want to support the project, please consider a donation. If you’ve got questions, please ask them. And perhaps most importantly: If you like this idea, please spread the word. Having Rubyists show that they back this effort is worth more than cash to me, because it gives me confidence that this might actually work.

At the time of writing, with the matching from Ruby Central, Inc., I have enough money for at least two weeks one month of work. That means this project is a ‘go’ even if no one else donates. Of course, a lot more can be done with 26 weeks than with two.

The next post about this you’ll see here from me is going to be a progress report of what I’ve been working on. Until then, thanks so much to those who have supported and will support this project. I think it’ll be a great experiment, and that good things will come from it.

AddThis Social Bookmark Button

This project upgrades an online forum to add a search engine, using Test Driven Development. Our tools are RoR’s Beast, Sphinx, and (naturally) assert{ 2.0 }.

We follow this MVC guideline:

Anything a user can do to the data through the Views,
a unit test can do, the same way, through the Models
Our test cases simulate a user searching.

Gregory Brown

AddThis Social Bookmark Button

UPDATE: Okay kids, now it’s 50% fantasy. It’s up to you to cover the other 50% by donating and spreading the word, after reading my proposal. Here’s hoping for the best!

UPDATE: Though my original post was 95% a fantasy, I’ve received some funding offers that have brought it down to 75% fantasy. I will be documenting any planning I’m doing towards via a wiki called RubyMendicant. If you’d like to follow this on the bleeding edge, keep an eye out on that wiki. Otherwise, if you hear an official announcement within the next few weeks, you’ll know I decided to take the plunge, and if you don’t, then it’s safe to assume this idea went the way of the dodo. If you like this idea, please spread the word through the usual means of the intertubes by sharing this post and the wiki link with others.

Here’s a crazy idea I just had, and I’m wondering what folks think about it.

People do open source for a lot of reasons, ranging from pragmatic to idealistic. Some write a patch every six months or so, others do what they can to dedicate their life to it. Though I try to have a life outside of software, I’m definitely more on the obsessed end of the spectrum when it comes to contributing to open source software.

I find myself in a rather unique situation: Single, living alone in a small studio apartment, only taking a class or two here and there, and basically living off of small contracts. It’s not that I’m not offered big gigs, or that I couldn’t go back to school full time if I really wanted to, I just find I enjoy living a simple lifestyle that lets me spend a lot of time on community oriented projects, especially Ruby stuff.

Right now, I need to do some work each month to pay the rent, and slowly save up to make sure I don’t get evicted during a slow work month. Between BTree and Madriska, I could say that I have two of the most open source friendly commercial relationships I’ve ever seen. Though I’m working on real projects with them, things that have to actually fit some sort of business need, they give me a lot of leeway to improve open source software while working on them, Ruport is pushed along heavily by this.

I could see myself doing that for a while. Working with a few different clients I trust, who in turn hook me up with interesting projects for a variety of companies in various different domains. A lot of it might be Rails work, but not all of it is. Still, in a moment of idealistic fantasy, I thought of another idea:

What if I could just do open source for a while, non-commercially?

How much would it cost for me to do at least 80 hours a month of development on software projects such as PDF::Writer, Ruport, and some other projects I wish I had the time to get my hands on?

I did the math, and the number came out low (subjective). I could meet all my expenses and save some money for about $2000 a month. Basically, if 200 people donated $60 right now, I could take 6 months off and do nearly 500 hours of work, and that’s only if I didn’t find myself obsessed with and doing extra hours on a project. I could more-or-less maintain my lifestyle that I have now, but not take on contracting projects that are either too big or too small out of necessity. Sure, this works out to be a lot lower than my contracting rate, but I could hack entirely on open source projects, maybe write some documentation and articles, and still be able to afford a class or two a semester. Sounds beautiful to me, though I’m sure it’s just a fantasy.

Indulging me for the moment, how would I remain accountable to anyone who supported such a venture? I’d make it transparent as possible. I’d record public hours, with links to changesets, tickets, blog posts, whatever. Though people would have to accept good faith (with at least a roughly outlined plan) as to ‘where I direct the time’, they’d get to see every bit of ‘where the hours went’.

What prevents this from being a total scam? You do. Though I don’t have some A-List reputation, I still make my living based on my reputation as a developer and a contractor. If I somehow totally screwed people who supported such an effort, all it would take would be enough negative feedback from the community to prevent me from getting away with dishonesty.

What would indicate a great success? If after 6 months, this all worked out, and I was interested in doing it for another 6 months, if people funded it, we’d know they actually liked what I did the first time around.

Finally, this doesn’t have to be me. It could be any old hacker you choose, someone you trust that’s working on things you’re interested in. They’d tell you how much it’d cost to have them quit their day job for 6 months, and hopefully people could pool resources. Though the open source community is kept alive by small day to day contributions, we all know the power of having someone dedicated to a project with copious free time.

I’m talking in theory, because obviously there are some complications. If I personally were to do this, I’d need to cycle out of some projects, and figure out to what extent it’d piss of the people I work with. Still, I am sort of curious, is this an idea that belongs in the trashbin, or should I open up a pledgie account for donations? :)

Maybe this is something that could be done on a trial basis, such as ‘40 hrs over 1 month’. This is something I could do without putting a close to all my work. Given that, based on my needs (not my billable rate), that’d be um… 10 dollars from 100 people?

On the one hand, this seems almost like a joke to me, a sort of ‘wouldn’t it be nice if…’. Still, if some respected Rubyist wanted to steal this idea, undercut me on the price, and ask people to start donating, would I be among them? You bet ya.

Let me know what you think. I’ve tried so hard over the last few years to find ethical and practical ways to work in open source development, and they pretty much work. But because of that, I’ve mostly ignored the idealistic ones, and this is just a shot in the dark at one of those.

AddThis Social Bookmark Button

The Problem

I find Ruby’s current warning system, if you can call it that, lacking. Warnings are controlled by the -W flag on the command line, and are generated via the Kernel#warn method within code. There are a host of problems with this approach to warnings.

Gregory Brown

AddThis Social Bookmark Button

Interesting:

I asked a question on Phlip’s last post about whether assert { 2.0 } was really necessary, given that it’s mostly just assert_block from Test::Unit. I noticed this question disappeared from the post, because I guess it was offensive somehow.

Though it made it through the second time around and Phlip answered reasonably, he sent me a private email explaining that he had censored me because I apparently don’t “get” assert { 2.0 }.

Not to pick a fight, but I personally believe that blog posts that have comments turned on should only be moderated for spam and/or abuse, which my comment was neither of. If you’ve got some questions about assert { 2.0 } that you’d like to see stay online without silent censorship, feel free to post them here.

This hopefully serves as a simple reminder that we should keep up with the ‘open’ in open source, and not silence technical questions randomly.

AddThis Social Bookmark Button

I like developer tests, but I don’t like the primitive assertions - assert_equal, assert_match, assert_not_nil, etc. They only exist for one reason - to print out their input values when they fail. And they don’t even reflect their variable names.

So I wrote an assertion to replace all of them. Put whatever you want into it; it prints out your expression, and all its values. Essentially like this:

__source__ __failure_diagnostic__
x = 43
assert{ x == 42 }
assert{ x == 42 } --> false - should pass
    x --> 43
deny{ x == 43 }
deny{ x == 43 } --> true - should not pass
    x --> 43

The classic versions require a lot more typing, and reflect much less information:

  assert_equal(x, 42)     --> <43> expected but was \n<42> 
  assert_not_equal(x, 43) --> <43> expected to be != to \n<43>

Install this system with:

  gem install assert2

Some systems might require sudo, to tell the ‘puter who’s boss. The “assert2” gem will pull in RubyNode, the library that inspects Ruby blocks. Then add require 'assert2' to your test suites, or to your test_helper.rb file.

Gregory Brown

AddThis Social Bookmark Button

The title of this post is the title of a talk I’ll be giving at NYC Ruby on February 12th.

Aside from blatent self promotion, I’m actually posting in search of opinions and thoughts to incorporate into this discussion, so that I can give a little more of a balanced account beyond my own crazy ideas.

Here’s my short and rather vague description of what I’ll be talking about:

Lots of people come to Ruby or stick with it because of the community, but what does that mean? In this short talk, we’ll take a look at what the Ruby community has meant over time, what it means now, why it’s dead, and why that’s not a bad thing. Not quite as depressing as it sounds, this talk will focus on how specialized groups such as local Ruby communities, regional conferences, and individual projects have developed their own distinct culture while still being impacted by the Ruby community of old.

What I’d like to know is what readers here have experienced with both “The Ruby Community” as well as Ruby communities in general. This could range anywhere from describing the general feel of your local Ruby users group to picking a bone with some of the ‘untouchable’ aspects of Ruby culture.

I’ve been trying to make my talks a bit more interactive in a sense, hoping to simply set up a discussion rather than pontificate, so having hearing your opinions will help me do that. In return, I promise to write another post titled “Why the Ruby community matters, and why it doesn’t” which will summarize any thoughts people have shared as well as the content of next week’s talk.

Anyway, looking forward to your thoughts. Feel free to be as bold as you’d like, and if you don’t want to be credited for your words, just post anonymously.

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.

Gregory Brown

AddThis Social Bookmark Button

Some of you may know that I’ve been working on The Ruport Book, a free-content book about Ruby Reports. Mike Milner and I have really learned through trial by fire some of the pros and cons of DIY technical publishing in the last few months. I’d like to share some of my thoughts here in a mini-ramble in hopes of stirring up conversation and ideas.