Why is Functional Programming so annoying?

I’ve been working on freeCodeCamp for the last couple of years, and they recently updated the curriculum. In it, they’ve added a whole section dedicated to Functional Programming. And, by gum, I find the whole premise extremely annoying and borderline rage inducing. Why is this?

Thanks for letting me vent. Obviously it’s not that big of a deal and I need to take a chill pill. I’ll remove this post on request.

Ha! Well thanks for being honest, and I kind of agree but I sort of know why it’s annoying for many people. You’ll find that any time a technique in computer science has become a One True Way to code then people will hammer it through and promote it even when it’s not appropriate. In functional programming it comes from an odd sense that the real world is somehow “dirty” and “common” so they try to avoid it at all costs, even when it’s fairly absurd to do so.

The best way to think about functional programming is that it’s a single useful technique that helps in some situations in programming, but that which becomes the only technique available in some languages. It is useful to learn, if only to give you a different way to look at problems and to learn concepts that are fundamental to computer science, but I find that their stance on the real world being dirty is where they tend to fall apart in reality.

@zedshaw Without going into my whole backstory in programming. I’ve found that, while FreeCodeCamp is nice for learning the technology and languages of the Web, I havn’t learned think from it.

It wasn’t until I got through 98% of lpthw that things started to click. And when it did, I stopped having “perfectionist meltdowns”, I got my creativity back (I’ve had creative block, for what feels like years). It has propagated to other parts of my life, as well.

So for that, you have my gratitude.

1 Like

Nice, well thanks for letting me know. You should definitely check out my next book:

https://learncodethehardway.org/more-python-book/

I got a whole lot in there on getting your creative mojo back.

I did! I purchased it a few weeks ago. I’m excited to start diving in!

Hi zberwaldt,

I enjoyed your rage-hating at functional programming. I feel your pain. I know what you mean. And I think Zed has already given a good answer about ‘the one true way’.

“I find the whole presmise extremely annoying” … ahh! But have you seen what is done to code whenever coders are put under pressure to deliver? When we learn new techniques, it’s often quite uncomfortable and you don’t really know why it is relevant. It tends to be that certain techniques work better for particular problems and that elegant code tends to come from the appropriate application of a technique to a particular slice of the problem. So, I think, I’m saying, functional programming is just different and that if you keep practicing it, you’ll find times when you read code and think “oh my god, these guys have never seen functional code”. Getting the functional paradigm will let you look at other coders work, and say, these guys have totally abused another paradigm, they really could have done with learning some functional programming.

I think this actually plays out across all the realms of CS. If you can only think in one ‘sector’ of CS, then you’re missing out on a whole host of other areas.

I really like this guy, the way he talked about all the different sectors that LISP let’s people use. The video is cool. Have a watch. It’s fun: http://landoflisp.com/

Oh and “I find the whole premise really annoying” … wait to you debug someone elses really ugly imperative code. Side affects everywhere. No pure functions. You’ll want to kill yourself, I’d risk guessing.

1 Like

Thank you @donal_m.

I’ve since calmed down from being angry and annoyed. I just think OOP thinking comes more natural to me. Learning a new way to think about problems takes time, patience, and practice. As you said.

Also, you were right about the video. It made me laugh.

Only thing is, there’s zero research that shows functional code (or any code) is any better than other code. In fact, there’s research that shows the quality of code with FP is lower and not better among MS students tested. Formal methods also don’t do better or worse than anyone else, and even after formal proofs of code there’s still terrible bugs in systems.

You should probably just read through this awesome list: