Euler meets Scala - Fun way to learn a new programming language

I have been following Scala for some time now and while it looks very promising, I didn’t get any further than reading tutorials and using the scala eclipse plugin for a few tryouts…. until just after Christmas when I got directed to Project Euler after reading Jeff Moser’s “How the legacy of a dead mathematician can make you a better programmer”. To get an idea what project Euler is about, I’ll quote from their website:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.

This got me started in Scala. And indeed, it has been fun for me. Not only because it dusts off my math but also because I like this way of learning a new language. If you have a little background in math and computer science you will find that the problems start quite easy and don’t require much code, which gives you the opportunity to experiment with the Scala language and API in a playful way while at the same time moving forward.

For me this way of actively working with a language has proven much more effective than just reading through example code. It just better sticks in my brain. Do you have a similar or totally different way to learn a new language? Let me know!

For the curious people: at the time of writing I have solved the first 17 problems (12 jan 2008).

Update: When listening to episode 158 of the Javaposse I heard that Jorge Ortiz did exactly the same thing. He also gives his solutions to a few of the puzzles so if you want to get a feeling of Scala and/or project Euler take a look there.

Comments are closed.

©2006 - 2012 Rintcius Blok