Monday, May 25, 2009

Higher Order Perl

There are a ton of "new" programming languages coming out of the wood work. All tend to solve different problems in varying ways. I'm completely fascinated with Clojure. Boo and F# look interesting.  Groovy seems right out for me because I don't know Java. Really many of these Java.Next languages look interesting. I'm planning to start with Clojure, though. The alternate languages that run on CLI could be useful at work. A lot of what draws me to these languages is the concept of Functional programming

Well, I just found a book on Perl (my "go to" language) that talks about using functional programming techniques in Perl. I started reading it online and it's clear that Higher-Order Perl: Transforming Programs with Programs is a must have for my bookshelf. One cool thing is that it puts names to some of the solutions that I figure out on my own. It made me feel smart. ;)  It also pointed out some of the potential dangerous behaviors that I have. For example, I've made some of my functions non-reentrant by using global dirhandles. It also gave me the solution to that problem. I now have an urge to go back through some of my larger Perl programs to see how much better I could write them now.

Higher Order Perl has already introduced me to some useful tools and I'm not even half way through reading it for free online. I think I've seen the Memoize module, but I never really thought it would be good for me. I never really took the time to read all the documentation on it. Now I know that I could have used it in a couple cases where I created my own caching. Here I thought I was being clever, but I was simply not using an existing module that would have done the job for me for free and probably would have done better than I did.

This all has me thinking: How much time do I want to invest in these cool new (to me) languages and how much time do I want to invest in making my current language skills stronger? I don't have an answer yet. I know I want to do some of both, though.

No comments:

Post a Comment