Archive for January, 2012

Some thoughts on classes after 18 months of Clojure

I had some thoughts about classes that wouldn’t fit into a talk I’m building about functional programming in Ruby, so I recorded them as a video.

Topics:

  • Using hashes instead of classes.

  • Classes as a documentation tool—specifically, as a way of making functions easy to find.

  • Preferring module inclusion to subclassing (which is akin to preferring adjectives to nouns as a way of organizing the documentation of verbs). (Vaguely similar to duck-typing in Haskell.)

  • Object dot notation as a more readable way of writing function composition. (Similar to the motivation for the -> macro in Clojure or type-directed name resolution in Haskell.)