Erudition and Inanity

brian guthrie blogs

The power of text

Posted by Brian Guthrie Thu, 03 May 2007 19:12:00 GMT

From the relevant email:

I’ve written such a document and attached it; ...

Thanks, Google.

Updated: Some email leaked through in the original image and I’ve fixed it. Remind me to be more zealous in my croppery.

Posted in | 1 comment |

I realize that this constitutes a flurry of activity

Posted by Brian Guthrie Thu, 03 May 2007 04:13:00 GMT

But it had to be done. Handshake 0.3.0 (should it have been 0.2.2?) will not enforce any contracts unless the global $DEBUG flag is set (ruby -d). Should have gotten around to it a while ago. Luckily, it’s a very easy change: don’t alias :new unless $DEBUG. A proxy object is never created, therefore no contract barrier exists.

Posted in | no comments |

Handshake at Boston.rb

Posted by Brian Guthrie Thu, 03 May 2007 02:31:00 GMT

This is just a quick note that I’ll be giving a brief presentation on Handshake next Tuesday at the Boston Rubygroup. Once I finish the slides they’ll be another nice introduction. Unfortunately the other Tuesday presentation is on Hackety Hack, with which I cannot hope to compete. Such is life.

Posted in | no comments |

Handshake 0.2.1 Released

Posted by Brian Guthrie Wed, 02 May 2007 16:45:00 GMT

I’ve pushed out a new version of Handshake. The big-ticket item in 0.2 is that method argument contracts now support contracts on blocks. When a block is passed to a method that’s protected by a block contract, the block will be modified to check the arguments and return values for that block in much the same way that a normal contract is checked. Note that this will probably not work in Ruby 1.9, or at least will have to be modified for recursive contract checking.

Here’s the syntax:

class StringArray < Array
  contract :each, Block(String => anything) => self
end

Block checking in 0.2.0 involved reopening the Proc class; release 0.2.1 fixes that.

The new release also contains a new method, checked_self. Because of the way Handshake is implemented (with a proxy object), calls to private methods aren’t checked (because they’re called on the real object instead of the proxy object). checked_self returns the proxy object instance and calls made to that object will be contract checked.

I’ve also improved the documentation. You can find the rdoc at http://handshake.rubyforge.org, and the project page at http://rubyforge.org/projects/handshake/.

Posted in | no comments |

They what said it best

Posted by Brian Guthrie Mon, 23 Apr 2007 15:05:00 GMT

Thanks, The Economist:

When it comes to most dangerous products—be they drugs, cigarettes or fast cars—this newspaper advocates a more [classically] liberal approach than the American government does. But when it comes to handguns, automatic weapons and other things specifically designed to kill people, we believe control is necessary, not least because the failure to deal with such violent devices often means that other freedoms must be curtailed. Instead of a debate about guns, America is now having a debate about campus security.

I recommend that you all subscribe; it’s excellent. Much of their content is also available online for free. I promise I’ll return to technical stuff soon. link

Posted in | no comments |

This is not a free speech issue

Posted by Brian Guthrie Tue, 17 Apr 2007 14:26:00 GMT

I am not a constitutional scholar, but it’s my understanding that the Bill of Rights is silent on the issue of an inalienable right to one’s own talk show. Don Imus isn’t in jail. This is all about community speech and the government isn’t involved. This is precisely how it’s supposed to work.

Posted in | 2 comments |

Chicago: in fashion

Posted by Brian Guthrie Sat, 14 Apr 2007 06:04:00 GMT

I’m in Chicago tonight for another job interview tomorrow. Never been to Chicago before, so that’s very cool, and I’m excited about the interview. Not much more to say except that downtown Chicago is stunning (and I get a 28th-floor view here), and that overriding Proc#call does not in fact affect the behavior of yield. Nobody expects the Spanish inquisition:

class Proc
  def weird(*args)
    # Only get all weird if we ask for it.
    puts "weird call!" if args.length > 0 && args[0] == "weird"
    orig_call(*args)
  end
  alias :orig_call :call
  alias :call :weird
end

def weird_call(str, &block)
  block.call(str)
end

def weird_yield(str)
  yield(str)
end

and you get:

>> weird_call("weird") { true }
weird call!
=> true
>> weird_yield("weird") { true }
=> true

This is frustrating, because I wanted Handshake to be able to support:

  contract Block(String => Integer) => 1..5

For example. Am I wrong? Or is there another mechanism for overriding the behavior of yield?

The degree to which Ruby’s core methods don’t appear to be orthogonal, instead employing lower-level mechanisms to do their work (Class#=== vs. Object#is_a? is another example) has been an unpleasant surprise to me.

1 comment |

And you thought you knew a tea

Posted by Brian Guthrie Thu, 12 Apr 2007 06:06:00 GMT

Bigelow Tea, a regular advertiser on Mr. Imus’s radio show, said it was suspending its current advertising and re-evaluating its future relationship with the show.

Apparently there exists some non-trivial subset of human beings who reside at the interstices of shock radio and soothing, understated beverages. Are they advertising herbal teas, I wonder, or caffeinated?

P&G, Others Pull Imus Ads (subscription required)

5 comments |

A word on Joshua Bell and the Washington Post

Posted by Brian Guthrie Tue, 10 Apr 2007 06:54:00 GMT

I’d like to take a stab at this one.

The article is written in a breathless style, full of affected shock and dismay and artificial, strained drama. It’s predictable nonsense that follows the same template as every other cultural critic: people today are morons; everything was better in the past; the world is going down the tubes. Just look at the followup interview that the author, Gene Weingarten, did on the piece:

One of his points is that if you look at a telephone manufactured in, say, 1935, it is a work of art. It could be a museum piece. Today, phones are dreadfully ugly utilitarian things. Same thing with brooms from the 19th century. Beauty used to matter, even in the banal.

The fact that beautiful brooms existed in the 19th century does not imply that all brooms were beautiful then (they weren’t) or that there aren’t beautiful brooms today (I’m sure there are). Utility has always mattered to people who cannot afford to pay a premium for (for example) a beautiful broom, and stating that all phones “today” are “dreadfully ugly” is patently ridiculous. People remember and preserve the beautiful and forget the ugly, and this myopia leads inevitably to the conclusion that things are getting worse.

This has been true for as long as people have been recording their history, and is a feeling shared by social conservatives at every place and in every era. Humanity has done nothing except grow richer, freer, less violent, and longer-lived (despite periodic catastrophes), and people still find a way to complain about progress.

News flash: busy people at a subway station that normally bans live performance ignored a busker. Shocking: art appreciation relies on context and popularity. Dear lord.

2 comments |

Marketing Community-Based Open Source Languages

Posted by Brian Guthrie Sun, 08 Apr 2007 00:53:00 GMT

What makes a good home page for a programming language? Is the primary purpose of a web site for a small, community-driven programming language to market the language, or to provide information for the community? Can you do both?

One thing that quickly becomes apparent when you stop and take some time to compare websites for programming languages is that most of them are God-awful, at least from a design perspective. Ruby and Python both look like they were designed by someone who knows what they’re doing and has been paying attention to contemporary web design, with the caveat that Ruby only recently finished its redesign. Scheme does a nice job showing off the language via a bizarre navigation menu that nonetheless encourages new users with an FAQ only to invite them to pick an implementation (tell me again how I get started?). Haskell, another functional language, shares an affinity for lambda logos with Scheme, and yes, I understand what lambda does and why you think it’s pretty great but for the love of God show some imagination. Correspondingly, Haskell’s web site is functional but unimaginative. Speaking of ridiculous lambdas, PLT Scheme wins the award for most flagrant abuse of gradients in logo design.

Smalltalk is cluttered, busy, and confusing, Perl looks like an O’Reilly cottage industry (which I guess is what it is at this point), and Javascript doesn’t have an official site at all; it has no user community because it’s a language that people are essentially forced into using. Searching for ‘ECMAscript’ gives you back the spec and a Wikipedia article. The site for D is ugly but tells you exactly what the hell it is right there at the top, which is more than you can say for most of these sites.

To what degree does programming language popularity depend on marketing, and to what degree should it be expected to stand on its own merits? Give witness, yea, here is a flash of the news: Programming languages are no different than anything else. Features are important but no one gives a damn unless you can explain to them why they should. That’s what “marketing” means in this context: explain to someone who visits your site why they should care or (better) how to get started, immediately. Ruby informs you: get started, it’s easy, and then gives you a link, right there at the top, where you can try Ruby in your browser (courtesy of _why).

Why can’t other, purportedly better, languages do the same? If you’re enthusiastic about your niche language and contemptuous of the ‘hype’ that Ruby and Rails enjoys, go out and spend some time advertising your language/framework/widget in a way that respects and encourages new users, and then come talk to me.

1 comment |

Older posts: 1 2 3 4 5 6