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? My next step up from "Hello World" should be relatively simple for most languages. 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. I second this approach. 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. Unless there are significant differences in the way a web framework is structured (i.e. Pedestal for Clojure), I find that making a web app doesn't really contribute much to learning the intricacies of 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. I like this idea! Having spent so long in Ruby land, I'm not as familiar with the Scala|Clojure|Haskell library scene, but I'm sure that's easily remedied. You would be surprised how easy it is! Often when new to a language, especially if it crosses paradigms, contributing to an existing project is difficult. Wrapping another library that may be obscure or niche allows you the freedom to fail and learn from your mistakes. I have had fairly good results just use it for data/calculation stuff that I need or using it without justification in a side project. Even if what you're working on is in X, do a bunch of your experimentation in Y. It costs more for the side project, but if you're not terribly concerned about the pace of the project then it's a net win. Practice new skills and have a presumably enjoyable task within which to practice them. I try to replicate a blog with posts, tags for posts, and users. It's a good way to get familiar with the ORM and creating associations assuming you will use relational data. I recently started learning Play Framework (Java/Scala web framework) and it worked pretty well. EDIT: This is assuming you are intending to learn a web framework along with the language. I'm not terribly interested picking up another web framework. I've looked into Play before but am looking for a non-web project for now! Choose your own adventure games seem to be one of the things that I work on for the longest Whichever project I'm most interested in actually doing at the moment. Simple games.