The Great Database Rewrite

I just discovered the paper The End of an Architectural Era (It’s Time for a Complete Rewrite), about re-designing database software from the ground up.  It contains some unsurprising predictions — “the next decade will bring domination by shared-nothing computer systems, often called grid computing” — and some interesting ideas: Any database smaller than 1… Continue reading The Great Database Rewrite

Testing Named Routes in the Rails Console

I finally found out how to do this, from the Rails Routing shortcut by David Black. In the Rails console, do this: include ActionController::UrlWriter default_url_options[:host] = ‘whatever’ Then you can call your named route methods directly from the console.

Parsing Complex Comparisons

An interesting tidbit: can your programming language parse a < b < c? Perl can’t. Ruby can, but returns an error “undefined method `>’ for false:FalseClass.” Interestingly, Python accepts it, and even gives the correct result. Something clever must be going on in the parser to make that work. Update October 17: Although Lisp can’t parse the expression… Continue reading Parsing Complex Comparisons

Why Doesn’t My Rails App Use memcached with cached_model?

Answer: you’re using the latest version of Rails (1.2.3), which slightly changes the syntax of its SQL statements. cached_model relies on a regular expression to match that SQL statement. To fix: Dive into the source of the cached_model gem, find the file lib/cached_model.rb, and change the first line after def self.find_by_sql to this: return super… Continue reading Why Doesn’t My Rails App Use memcached with cached_model?

Ruby vs. Lisp

I’m certainly not the first to do this, but I felt like writing it. Comparing Ruby and Common Lisp: Syntax: Advantage, Common Lisp. No contest here. Ruby’s syntax is ugly, with all those ends hanging around and the { |var| … } block syntax. The one thing Ruby has going for it is conciseness. The… Continue reading Ruby vs. Lisp

The Virtues of Static Typing

When I first discovered dynamically-typed languages like Perl and Ruby, I was convinced of their superiority to statically-typed languages like C++. No longer did I have to waste hours typing redundant type declarations or adding casts just to make the compiler happy. Dynamic typing allowed me to work quickly and unencumbered in what felt like… Continue reading The Virtues of Static Typing

The Weirdness of C++

I’ve been dredging up my C++ for a class recently, and I’m struck by just how weird it feels now that I spend most of my time with Ruby. I was all proud of myself for remembering how to write a copy constructor. Then I ran into a situation like this: MyClass a = foo;… Continue reading The Weirdness of C++