• Uncategorized
  • Ruby’s Forwardable

    Last night I had the pleasure of attending the Arlington Ruby User Group meeting in Arlington, Virginia. Marius Pop, a new Rubyist, presented on Ruby’s Forwardable module. Forwardable allows you to very succinctly specify that you want to define a method that simply calls (that is, delegates to) a method on one of the object’s […]

  • Uncategorized
  • Conway’s Game of Life Viewer

    Later this month I’ll be joining dozens of other coders at Ruby DCamp, where we’ll spend three days talking, coding, and camping. The first day is usually code katas (exercises), and often one of them is the implementation of Conway’s Game of Life. By design, there’s not enough time to do a complete implementation with […]

  • Uncategorized
  • class_eval, instance_eval, eval

    A couple of days ago I attended an interesting discussion of metaprogramming by Arild Shirazi at a meeting of the Northern Virginia Ruby User Group. Arild showed how he used metaprogramming (class_eval in particular) to generate functions whose names would only be known at runtime. His talk was very effective at reminding me that I […]

  • Uncategorized
  • Design by Contract, Ruby Style

    I recently encountered a situation in which I was writing data to a key/value data store. There was a code layer that insulated the business logic layer from the data store internals. I wanted to be able to unit test this business logic without needing access to the data store. I could mock the data […]

  • Uncategorized
  • Android GUI’s — The Case Against GUI Builders and Data Driven GUI Configuration

    GUI builders are great, but for building anything more than a trivial solitary application, without discipline and diligence, the duplication can create a productivity and quality quagmire. In addition, XML is a human-hostile configuration language. Copy and Paste – Bad! As the number of windows increases, the natural tendency is to copy and paste. For […]

  • Uncategorized
  • Singapore and Its Red Dot RubyConf

    The Conference On April 22-23, 2011 was the first ever regional Ruby Conference in Southeast Asia (http://reddotrubyconf.com, Twitter tag #reddotrubyconf). (Conference links and resources provided by @cheeaun are here). It was really cool seeing people from so many different countries in the region unite around their appreciation of the Ruby language. In additional to the […]

  • Uncategorized
  • Sun Java Coding Conventions Revisited

    The Sun Java Code Conventions document, written in 1997, and available at http://java.sun.com/docs/codeconv/, continues to be a valuable resource for Java programmers. In addition to the nuts and bolts of formatting and the like, it includes some great wisdom, such as: The frequency of comments sometimes reflects poor quality of code. When you feel compelled […]

  • Uncategorized
  • Bangspace — Bangkok Hackerspace

    One of the manifestations of community among IT professionals and enthusiasts is the hackerspace (see Wikipedia article at http://en.wikipedia.org/wiki/Hackerspace). A hackerspace is a place where hackers (in the loose sense of the word, that is, benevolent software and hardware enthusiasts) can meet to talk, learn, and work together. A recent addition to the hackerspaces of […]