Technology Musings

January 23, 2009

Amusing / Historically Bad Ideas in Programming

JB

The QCon developer's conference this year has an interesting track - historically bad programming ideas.  However, I have to say that I'm actually a big fan of the null pointer, despite the issues that it gives some people.  The fact is, without null, nil, undefined, or 0 (depending on language), the actual task of programming would be much more difficulty.  And, I would argue, would cost more than the bug-savings that we would get from having non-null type systems.  In order to get around them you would have to write code that is more confusing and more time-consuming, and you might even wind up with the same set of bugs, just moved around slightly.

January 20, 2009

Features / I Dream of acts_as_tsearch2

JB

Two plugins I would love to have for Ruby on Rails, and would love to build if I had the time:

acts_as_tsearch2

This would be an ActiveRecord layer for integrating with PostgreSQL's tsearch2 full-text indexing.  Right now, I am not aware of a Rails plugin that does that.

search_coalesce

This would take the results of multiple paginated queries and combine them together.  For instance, right now I'm writing a program using acts_as_solr for searching.  However, I also need to refine the results using named_scopes, and some of the searches would most naturally fit into a named_scope.  Therefore, I would love to be able to take the results of each query and combine them together on the fly in a paginated way.  If this sounds impossible, I've already dreamed up a basic architecture.  Here's a hint - just make sure that all queries have the same sorting.