Showing posts from December, 2007

links for 2007-12-29

links for 2007-12-25

Product: Amazon's SimpleDB | High Scalability
Large list of links related to Amazon SimpleDB
(tags: simpledbdatabase)


Coding Horror: Size Is The Enemy

Java is like a variant of the game of Tetris in which none of the pieces can fill gaps created by the other pieces, so all you can do is pile them up endlessly.

links for 2007-12-24

links for 2007-12-22

How Not To Write An API

So a future version of Rails will get Pluggable Controller Caching. That's a good idea, and good on Rails for formalizing this extensibility. Better than monkey patching.

Looking at the implementation, though, leaves me cold. Let's look at a code snippet:

def read(name, options = nil)

With some commentary:

Invoking super for each method call ensures that the proper messages get logged for each action

Wow, way to trust your users! </sarcasm> Requiring a call to super is very bad practice. Any time you are relying on a client of your class to call something, you're risking someone forgetting to make the call.

It's better to use the Strategy Pattern. Here, you finalize the API method (here it is read) and provide an abstract method or your subclasses. Marking the method as final (which I don't think you can do in Ruby, but I digress) ensures that a subclass can't override your functionality, and the abstract internal metho…

links for 2007-12-20

links for 2007-12-19

links for 2007-12-15

SQL Server Adapter for Rails 2.0

UPDATE: Everything works now. Turns out I had a plugin installed that monkey patched the SQL Server Adapter. This plugin was from an older version of Rails, and the Rails 2.0 adapters now extend from AbstractAdapter. Fixing the parent class in my plugin monkey patch (to extend from AbstractAdapter) fixed this up and now I no longer get the error.

I just installed the SQL Server Adapter Gem from for my new Rails 2.0 project:

gem install activerecord-sqlserver-adapter --source=

When I attempt to use it, I receive this error message:

TypeError: superclass mismatch for class SQLServerAdapter
from /var/lib/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:190
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /home/sladd/development/workspace/DSES2/ve…

Programming in Scala - The Book

Artima has just released a pre-release copy of Programming in Scala. Much like the Pragmatic Programmers handle their book publishing, you can buy the pre-release copy as a PDF now, and Artima will provide free updates as the book progresses. You can choose to purchase just the PDF, or the PDF/Printed bundle.

Scala is a really fun programming language, combining object oriented and functional aspects into one dynamic and powerful package. Best of all, Scala runs on the JVM, so it can take advantage of the entire Java ecosystem.

If you're interested in functional programming (and you should be) but don't want to completely abandon your investment in OOP or in Java, then you need to give Scala a look.

One of my favorite features of Scala is the Actors support. You can use Actors to achieve Erlang style concurrent and scalable systems on the JVM. Now that's hot.

links for 2007-12-13

NPR Music: Best CDs of 2007
(tags: music)

NPR Music: Assads Mix Classical Guitar, Brazilian Heritage
(tags: music)

YouTube - How It All Ends
amazing, rational view on an issue that is a no brainer
(tags: video)

links for 2007-12-12

links for 2007-12-11

links for 2007-12-09

Douglas Crockford on Software Quality

When Douglas Crockford talks about Software Quality, you should listen. If you are involved in writing software and need to understand why software is difficult, or if you are planning a software project, you need to watch this presentation.

Includes such gems as "No rational person can do software", "Programmers don't understand how they spend their time", and "If you took all the code you wrote over the past year, you could probably type it into the computer in one day." One of my favorites: "Programming is a social activity."

Oh, and mad props to Crockford for drawing a parallel between building software and Mr. Blandings Builds His Dream House. Not only is it a funny movie, it's one of my Mom's favorites. While Crockford found many apt parallels, he unfortunately was wrong about one. Software construction is not nearly as funny as this movie.

Partially related to this presentation is Joel's article on Five Ways to Fail a S…

links for 2007-12-07

links for 2007-12-06

links for 2007-12-05