
- Image via Wikipedia
This is the first post in the series of How <x> changed my style where I shall talk about tools and events that had a significant impact on my style of doing things. If you happen to like this idea, I would be very happy if you could help it spread like wildfire, because it’s a form of pay-it-forward where we say Thanks for cool stuff.
Some months ago, fuck has it been two? three? four?, I attended a series of lectures on Lisp and functional programming and some other useful thingies by Simon Belak. At first it all felt like just another useful tool under my belt. Cool, Lisp, yeah, so what do I do with this? Meh, it’s cool, knowing this can’t do any more harm than a parenthesis thrown at a boomerangual trajectory smashing the windscreen of our hapless programmer.
However it did do damage, dear god it did so much damage! It fucked with my mind man, it fucked with everything. Nothing has been the same since!
No not really, but lately I have started noticing some pretty remarkable changes in the way I write code and more importantly, the way I think about code. Suddenly everything is a function is a function is a function! It’s quite remarkable really, sure I’ll often still code the very obvious object as an object, but I’m no longer forcing object oriented programming where it doesn’t belong.
And then there are even more radical examples of my brain changing, for the better I believe. Let’s take a simple comparison of writing a function that calculates the average of a list of numbers. In the old days I’d write it like so:
avg = 0
for key in self.tags:
avg += self.tags[key]
avg /= len(self.tags)
These days, and it was fucking surprising when I noticed myself doing this, the same function gets written with a much bigger lisp:
avg = reduce(lambda a,b: a+b, tags.itervalues())/len(tags)
I really couldn’t go so far as to say whether this change in style and thinking is good or bad, but it certainly is interesting to just sit back and watch yourself from a distance as you morph and change before your very eyes.
So what’s changed your style lately?
Tags: Computer programming, food for thought, Functional programming, Languages, life, Lisp
or see the music I like on last.fm,
or perhaps leave a comment, I like comments,
or go do your job because I know you're slacking,
or go write a blog of your own,
or tweet about something interesting,
or go out and have some fresh air,
or find a girlfriend,
or a boyfriend,
or a manbearpig,
or for fuck's sake stop reading this already,
no?
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=302cb13b-8c78-4125-859c-9fba78b58659)
5 comments so far
Leave a reply