Categories
Extreme Blue Programming

Programming Toolboxes and Functional Hats

Chairs
Credit: flickr / Thomas Hawk

Much to the entertainment of my teammates and mentor, on Monday I punched the air and exclaimed:

YES! I am a <long product name> NINJA!

We’re exporting some data from this product (let’s call it Product X) and I had fixed a 3-4x expansion in the number of records it was producing. This made me pretty happy! Even happier, when my solution was deemed the neatest (as it skips an intermediary table with an extra column) by a master engineer and is now the answer on the forum.

I really don’t aspire to be a Product X Ninja, after mastering MS Word with my 400 page undergrad thesis (yes, I know, I should have written it in LaTeX) I intended to become a ninja of some programming language instead of proprietary software, even if it takes 10 years.

Anyway, what did I do? Essentially, I sorted the records in such a way that it gave me a property I needed – I could decide whether or not to keep a record n solely from information in the record n-1.

I have some ideas about becoming a competent programmer. I aim to know something of: an Object-Orientated language (Java), a scripting language (Python), a functional language (Haskell), and have done enough C to understand something of why it’s such a painful language to code in. I theorize that this is a toolbox, which is makes it possible to hack in other languages that come my way.

However more than that, I’ve realized that being happy to code in these different kinds of languages gives me different modes of thinking. I’ll solve something from a functional perspective in a very different way from how I’ll solve it procedurally, or in an OO-context.

And whilst I need to stop trying to program functionally in Java (it invariably ends badly), here putting on my functional programmer hat was really helpful.

Of course, in functional language I wouldn’t have the extra conditional because of the bizarre API design that deals non-intuitively with null values.

But that, well. That’s a story for another day.