Aliens sending messages, Water flowing over a map and finding the hidden Welcome message in a String... Yes, Google Code Jam has returned for the 2009 edition! I participated in the Qualification Round and managed to solve all but 1 input set....
(more...)
Tags: Functional Programming, Google, google code jam, Scala
Filed under Functional Programming, General, Java, Scala | 4 Comments »
I have read about implementing the bowling game XP-style many years ago in Robert Martin's book 'Agile Software Development'. The episode can be found online as well.
Recently he has recently been learning Clojure and attempted to implement the bowling game in Clojure.
It is a nice exercise, and although I like Clojure, I do not regard myself capable in any way to repeat such an attempt. Apart from that Stuart Halloway, author of the excellent 'Programming in Clojure' book, has already done this in a much better way than I ever could. I'm slightly more familiar with Scala, so I thought it would be a nice exercise to try some functional bowling using that. My Scala knowledge is in a deplorable state, stuck at pre-beginner level, so I run the risk of making a complete fool of myself. However I'll take the chance and at least try to learn from the experience.
Tags: Functional Programming, Scala
Filed under Functional Programming, Scala | 7 Comments »
I recently started reading Stuart Halloway's book 'Programming in Clojure'. I don't think I will be writing much enterprise applications in that language in the near future, but it never hurts to broaden the mind, and it's a very good read. In his book, he demonstrates some of the advantages of functional programming by taking an example from the Apache commons library: StringUtils.indexOfAny. He has also written a blog about it.
In this blog post, we'll compare the original function in Java, the Clojure version and a Scala implementation.
(more...)
Tags: funtional programming, Scala
Filed under Functional Programming, Scala | 15 Comments »
Last week I came across an interesting "coding kata" by Brett Schuchert on the Object Mentor blog. The trick of a kata is that you grow the program step-by-step using tests, just like a kata in karate is tought to a student. The problem of this kata was the Shunting Yard algorithm of Dijkstra. I wanted to see if I could implement this kata in Scala.
(more...)
Tags: Functional Programming, kata, Scala, shunting, yard
Filed under Functional Programming, Scala | No Comments »
While attending QCon San Francisco, I had the particular pleasure of attending a whole track that was devoted to the area of functional programming, a topic that I have a profound interest in. After having followed the track, I'm even more convinced than before that functional programming is not confined the the academic world. I think that it will have a profound impact on our mental perspective and the way we think about programming and problem solving in the next coming years. In this blog, I will summarize the sessions I followed, provide you with a couple of thought provoking ideas that I picked up, and hopefully makes you think about your programming style.
Tags: Functional Programming, qcon
Filed under Functional Programming, qcon | 1 Comment »