On functional programming
by elbekko on Feb.28, 2009, under Contemplations
I’ve been thinking a bit about the subject of functional programming lately, especially since it seems to be quite popular nowadays.
So naturally I look up guides and wiki pages and whatnot about the subject, research a language (I took Haskell because everyone says it’s awesome), etc. But every time I do so I just scratch my head and have a rather blank stare… It seems completely alien to me, and there’s hardly any aspect of it that I understand or even find remotely logical.
Some people have been trying to convince me it’s just because I’m unwilling to learn it properly. I disagree with that. And here start my contemplations on the subject.
I have problems with maths, I even have a proven learning disability called dyscalculia, which causes me to be very bad at calculating things and remembering formulas amongst others. And I believe this is why I have difficulty grasping most of functional programming: everything seems to have its roots in maths, and to truly understand it you have to understand its roots. Which I can’t. Which is a problem.
Now, ‘regular’ programming, AKA imperative programming, I have absolutely no problems with. And I like to believe this is because my brain seems to be geared rather towards logic, on which all imperative languages are built. Describing what to do to a computer by telling it how to do so seems much more logical to me than the functional programming approach, which just tells the computer what to do, with seemingly little control of the how.
To prove my point further: I recently found my true love to be with Assembly, because I find it to be so awesomely logical. I finally know how everything is done at the lowest level I can comprehend (no, I don’t have a built in hex translator), and it helps me write better imperative code in other languages. Functional programming just doesn’t give me the idea that I’m programming and making the best and most performant piece of code I can, as I don’t control what the compiler thinks I mean with a certain command.
So, to sum it up:
1 xor 0 = <3
1 !^=< 0 = the hell?
Note: this may or may not be an actual Haskell operator, but I wouldn’t be surprised if it was.