Hacking up a storm: Scala takes to the command line

June 3, 2009 at 10:22 pm (Scala, Scheme, Week 11) (, )

Today was a bit slow going, but I was in a pretty good state of mind, and Scala was feeling a little better. At some point something started to click a little bit on the micro level for functional programming, and I mentioned that I thought functional programming would make testing easier. But when I tried to explain it to Micah, I realized that the problems I had been having with testing in my normal imperative loop were more due to the fact that I hadn’t really thought out what I needed to test in that loop. In fact, my problems were cleared up pretty easily with mocks (hand-rolled — I’m not sure if there’s a mocking library for Scala or not).

Tonight I hacked out the minimax algorithm and have a working (albeit slow) computer player on the console. I got a little stuck a few times, but I remembered that the breakthrough last time (in Java) was to slooooow dowwwwn and make sure I understood precisely for WHOM I was calculating the score for a given board.

I did some Pomodoros when I got home: 25 minutes on, 5 minutes off. I ended up alternating between coding and reading this Programming in Scala book during my “on” sessions, but eventually I got so involved in the minimax problem that I forgot about the timer and just kept going (much to my wife’s chagrin).

I did a few rounds of Scheme code kata as well, in preparation for my Lunch & Learn talk on Friday. I’m realizing as I practice these more that there are a few more topics I need to introduce in the slides portion of the presentation in order to have the kata make sense; probably will get to that tomorrow.

Hooray for progress! Now I have lots of refactoring and GUI code to look forward to.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: