A year ago today, on August 8th, 2013, I began a hackathon where I decided to attempt something that seemed like a fun idea that had come over lunchtime conversations. Project Euler is fun, but (the early problems, especially if you have done them once before) fairly easy. Solving problems in esoteric languages would certainly make it more of a challenge...so, instead of picking one or two esoteric languages and sticking with them, why not just try to use as many languages as possible, forcing the use of more and more obscure languages?
During that hackathon, I reached my goal very exactly - just minutes before 24 hours had passed, I solved my 20th problem in my 20th program language.
After that hackathon, I decided to continue - sure, 20 problems in 20 languages wasn't the easiest thing in the world, but I already knew half or more of the languages that I had used, how long could I go using new languages? Would I run out of languages I would be able to learn? It seems that that was not the case, as I eventually reached a lofty goal of 50 problems, and now, almost by accident plus a small push at the end, I have solved 100 problems in nearly as many languages in a year.
So, I suppose this is a good time to reflect on things. This has been a very fun project, not only because it allowed me to dive back into Project Euler, which I hadn't done much of anything with for about a year at the time I started, due to running out of problems I felt as though I could solve (though many of those very problems I have solved in this challenge, with the advantages of more education and learning the lessons of going through in order to help me). And also, though I first thought that this project would mostly just lead to me learning a bunch of nonsense esoteric languages (and don't get me wrong, I have used Befunge, Whitespace, LOLCODE, and others, so that is definitely still happening), I have used a number of languages that actually are used a lot that I knew nothing about prior to this project (Ruby, Perl, D, and more like this).
However, I think more important than learning any one language in this project - and indeed, I am wary of using that term, many of the languages I have used for this blog I would not say I have "learned", I have only experimented with them briefly - I think more importantly this project has developed a skill of being able to learn languages quickly and think of solutions to problems in language-independent manners that has allowed me to often write a solution in an entirely new language the day I learn the language, even if that language is not highly similar to other languages, and often even "learning" more than one language a day. Further, switching languages so frequently has decreased the inertia I experience when switching languages. I remember last Spring when I often had to switch between Scala code I wrote for class and C++ code I wrote for G3D, I would often make silly mistakes, using syntax for one language in another (such as array access syntax arr(i) in Scala, arr[i] in C++). Though I often switch must more frequently now than I did then, I make far fewer mistakes of that kind than I did then. And indeed, switching more often is the case, though it doesn't seem crazy when I am doing it, it seems like a lot to write down that since Monday (and today is Friday) I have written code in C++, Python, Moonscript, E, E#, Pike, Java, Kotlin, Mathematica, and Yeti.
I would definitely encourage anyone to try a challenge such as this themselves. Whether they are already fairly seasoned as I was and want to try using 100 languages, or just maybe solving project Euler rotating through 3-10 languages, this programming challenge has been a great learning experience. In addition to of course just being fun, a great distraction from actual sources of work, and occasionally leading to interesting mathematical insights (because yeah, there is that side to Project Euler too).
So, I have solved 100 Project Euler problems in all different languages in a year. Will I be able to do another 100 next year? I doubt it because of problems increasing in difficulty and languages getting slimmer and slimmer, but that's what I said at 50, so who knows.
No comments:
Post a Comment