Also, you might want to look at the
Computer Language Shootout. There are a lot of little programs implementated in a lot of languages which can give you some code examples to look at. (although I hesisitate a little because of the shootout's emphasis on performance over simple and clear code)