Ask HN: Favorite projects for learning a new language?
Most of what I do day to day is web applications with Ruby/Rails. I'm looking into picking up a new language or two for fun (so far toyed with Scala, Clojure, and Haskell), and I find I learn the concepts best when I put it all together in an actual project. I'm not so interested in more web stuff or challenge-based things like Project Euler / CodeEval.
What are your favorite micro-projects for picking up a new language?
11 comments
[ 3.5 ms ] story [ 37.1 ms ] threadEDIT: This is assuming you are intending to learn a web framework along with the language.
I like to try out a languages interesting features by wrapping an existing library in an idiomatic style suitable for that language. For example my most recent work is attempting a wrapper around SNMP4j in Clojure, foregoing the OO style for a more data-centric approach.
Pick a public JSON API. Retrieve it over HTTP. Parse the JSON into a data structure. Print some interesting part of the data.
This exposes you to HTTP and JSON libraries in a new language, as well as working with data structures. For instance, in Go, the parsing JSON step forces you to write some structs and learn about marshalling.
It lets you work with a few of the available libraries in the language (network, parsing, etc.), gives you some insight into data structures and helps you learn the idioms in API design in the language. It's also easy to do incrementally because you can typically get a single API working and then build from there. What's more, its fairly easy to write tests for, thereby exposing you to that languages testing libraries and methodologies. And sometimes you even come up with something useful that someone else might need.