My Month of New Technology

Jun 21

Speaking @ Refresh the Triangle

I’ll be giving my talk at Refresh the Triangle this Thursday here in Durham. More info is available on the website. If you’re in the area, I hope you’ll come out.

Jun 17

Peer Pressure Learning Experiment

Just received a tweet from Tim Harvey that he and a friend are undertaking their own month of new technology. It’s an incredible feeling to see people picking up where I left off.

Good luck, Tim and Miles!

Jun 16

Another Writeup

I put up a detailed writeup of the experiment on my company’s developer blog.

May 21

It is finished

The Month of New Technology has drawn to a close. I put a short write-up on my website, including slides from the presentation I gave at DevNation Chicago on Saturday.

As a follow-up, I’m finishing up The Little Schemer and then digging into Real World Haskell. If you’ve gotten anything from reading these posts, let me know on Twitter. Thanks for reading!

May 11

Day 30: Riak

This is it, folks. For the final stop on this tour, I took a look at Riak, another entry in the NoSQL race. It feels most similar to MongoDB with its use of JSON to store documents and ability to execute map-reduce functions written in Javascript, though the documentation refers to it as a key-value store, which would put it closer to Redis. Unlike CouchDB, installing Riak with Homebrew went off without a hitch. With that finished, I headed to the project homepage and opened the Getting Started guide. It showed how to start the Riak server and make a basic query using cURL. That it can be accessed via HTTP using a RESTful interface as well as with native Erlang is one of my favorite features of Riak.

After that, I opened the doc page outlining Riaks’s entire REST API and played around with storing, retrieving, and deleting my own documents, which all worked about as expected. Then I opened the Riak Fast Track, and worked through that. I thought it was especially cool that you can store binary data (e.g. an image) in Riak and then retrieve it with a web browser, though maybe I’m easily impressed.

Once I felt like I had a good handle on basic Riak functionality, I took a look at Ripple, the Riak Ruby library written by Sean Cribbs, a local developer. Ripple depends on a number of libraries that I don’t use on a daily basis, so I had to do some RVM wrangling to get everything working. The library has two parts (from the docs):

Both libraries work well. Ripple has support for ActiveRecord-style has_many relationships using embedded documents. I spent some time reading through the source, and I especially liked its extensive use of tap, a method I was aware of but tend to underuse in favor of returning.

Riak is very cool. I stand by my earlier assertion that it feels more like Mongo than Redis, mainly because it seems like it’s intended to be an application’s primary data store. That it’s built to scale up quickly and easily is compelling, but I think it needs to do more to differentiate itself from the rest of the NoSQL pack.

May 10

Day 29: CouchDB … sort of

To cap off this month-long journey, I planned a NoSQL double-header with CouchDB and Riak, the last two technologies on my list. I decided to tackle Couch first, but, like Barry Sanders in his heyday, it opted not to be tackled. I couldn’t get the ICU library to build with Homebrew despite an hour of effort, which made installing Couch impossible. It looks like this is an established problem with Homebrew, so I fully expect this will all just work next week, just in time for me to not give a damn.

It’s too bad, too. I was really looking forward to working through this tutorial. It looks like MongoDB wins the battle of the document-oriented databases by virtue of showing up.

May 09

Day 28: Haskell

For the second half of today’s in-flight double header, I spent an hour with Haskell, another functional programming language similar to ML (and by extension, OCaml). I didn’t have as much luck finding good resources for Haskell as I did with Erlang; I started with Learn Haskell in 10 Minutes, which worked about as advertised, and from there, dove straight into a PDF version of Real World Haskell, the classic book for learning the language. I was happy to see that the PDF copy omits the giant beetle from the cover, which is the only thing stopping me from buying a paper copy of the book.

The book is very well written, if somewhat verbose. It spends a lot of time explaining the rationalization behind the language features and contrasting them with those of other languages. I wasn’t able to get a version of fold together in the allotted time; it’s been my observation that strongly typed languages have a much steeper learning curve than weaker ones — contrast Clojure with Scheme, for example, or, just today, Erlang and Haskell. That said, Haskell’s type system looks fantastic, and the way it handles generic types makes total sense and seems to alleviate a lot of the difficulties I had with Scala and OCaml. When you declare a function, you can say, literally, this function takes an ‘a’ and a ‘b’ and returns a list of ‘[a]’, and the compiler will fill those variables in with actual type values at compile time.

Though I’m disappointed I wasn’t able to get further into the language, I have a good base to start from and a good resource with which to learn more. Working my way through this book is second on my list of follow-up activities, right after finishing The Little Schemer.

Day 27: Erlang

I’ve always been intimidated by Erlang; its syntax is just similar enough to languages I know that it seems like I should be able to read it, but different enough that I can’t. Undaunted, I installed it with Homebrew, loaded a few PDFs onto my laptop, and boarded the plane back to NC. I started off with the total idiot’s guide, which was just about right. It showed me how to use the interactive console and compile a basic program. From there, the official site provided a link to the Erlang/OTP System Documentation, but at 300 pages, it was a little dense for my purposes. Fortunately, I was able to find a link to Getting Started with Erlang (PDF), weighing in at a much more manageable 58 pages. I managed to work my way through about half the guide in an hour, and though it was last updated in ’04, I can testify that it does a fantastic job walking new users through the basics of Erlang.

I think this hour was the biggest success thus far. As I said before, I’ve looked at Erlang in the past, but was always too intimated to really dive in. This time, things were different, for three key reasons:

  1. The fixed time window. There were times where got frustrated or reached natural stopping points, but I forced myself to keep pushing to fill out the entire hour.

  2. Knowing how to learn. I’ve developed a much better sense for how I learn best. None of the current docs really hit that sweet spot for me, so I dug around until I found a guide that really suits me, using interactive code examples that build on themselves as they increase in complexity.

  3. Understanding language patterns. Jumping into Erlang from a strictly object-oriented programming background would have confused and bewildered me. Because of my experiences in the last month though, I was much more able to indentify language features. Specifically, Erlang’s pattern matching is very similar to that of OCaml, and the idiom of assigning variables to the head and tail of a list, doing something to the head, and then recursing with the tail is straight out of The Little Schemer.

Here’s my Erlang fold:

-module(fold).
-export([fold/2, fold/3]).

fold([First | Rest], Fun) ->
  fold(Rest, Fun, First);
fold([], Fun) ->
  [].

fold([First | Rest], Fun, Result) ->
  fold(Rest, Fun, Fun(Result, First));
fold([], Fun, Result) ->
  Result.

% 10> fold:fold([1,2,3], fun(Sum, Item) -> Sum + Item end).
% 6

I’m feeling really encouraged by this experience. This is the first time where I’ve felt this month has reaped rewards above and beyond learning the individual technologies, and just in time for me to put together my DevNation Chicago talk. Now: onto Haskell before my battery gives out.

May 08

Day 26: CSS3

After missing yesterday (my first out-and-out failure), I decided to hop back in with CSS3. CSS, or cascading stylesheets, are the way the look-and-feel of websites are defined. Good websites, at least. We’ve basically been using CSS2, or some version thereof, for the last ten years. As older browsers are getting phased out and replaced by newer ones, though, we’re starting to see designers get more comfortable using CSS3 properties, like rounded corners, in their websites.

To kick it off, I looked at this article from WebMonkey. WebMonkey holds a special place in my heart, since I basically learned Javascript, CSS, PHP, even Flash from the articles they published in the mid-to-late nineties. It presented a very basic overview of some CSS3 properties. Next, I waded through countless “TOP 97 CSS3 TIPS AND TRICKS” posts and found this intro from Smashing Magazine, which provided a much more thorough intro to the capabilities of CSS3.

Feeling pretty comfortable with the various properties available, I pulled up this tutorial from NetTuts and worked my way through it. Super cool to see multi-column text and table-based layouts in action. Finally, I messed around with some of the cutting-edge CSS animations. This page especially did a good job presenting some of the options with easily-readable source code.

CSS3 was by far the least technical subject I’ve addressed this month, but I’m glad I took an hour to get a handle on all of its various abilities. Also, it was good to get a bit of a breather, as I plan to tackle both Erlang and Haskell on the plane ride back to NC tomorrow.

May 06

Day 25: HTML5

Greetings from sunny Burbank. Today I spent some time with HTML5, the new specification for web markup. There’s a lot of stuff in HTML5, but I chose to focus specifically on offline storage. What local storage accessed via Javascript has to do with HTML … not sure. But I’m glad it’s here.

As part of HTML5 local storage, modern web browsers ship with a built-in relational database. Most of the information about this functionality seems to be from around 2007, and a lot of it is outdated, but I found a working example and was able to pick through its source code. I created a small todo list app — pretty crappy, but enough to get a feel for how it works. As a Rails guy, I don’t spend much time writing SQL, and when I do, it’s because a problem has gotten particularly interesting. Having to manage my own database connections and write the SQL commands to insert data felt like a step back to 2005. If I was to build an app this way, I’d definitely check for some kind of ORM — JazzRecord looks decent, but doesn’t support HTML5 at the moment.

Next, I took a look at local key-value storage. Apple’s WebKit docs were spot on, and it was dead simple to store and retrieve values in the browser console. I rewrote my todo app to use this alternate data store, which worked decently, though I was disappointed to find that arrays can be stored, but come back as strings. It’d be incredible if it worked more like Redis, letting you store more advanced data structures. I guess it’d be easy enough to store JSON, though I don’t know what the performance hit is for serializing and deserializing data on each request.