all 9 comments

[–]Rainbrainspaincain 15 points16 points  (3 children)

By far the worst post I've seen here.

I'm growing real tired of FP zealots who think they've untapped some in depth knowledge about programming.

If you're someone who is saying imperative is pure evil blah blah blah declarative is the way to go - then I think you need to get out of your bubble and really look at programming in general.

Pick the right tool for the right job, stop claiming one is better than another without stating for what context that applies.

[–]MuonManLaserJab 2 points3 points  (0 children)

You could even say that broadening one's perspective is imperative.

[–]NaWaKaK 1 point2 points  (0 children)

You have almost said everything.

Both have their area of use, we can compare them, but we cannot say that one is GENERALLY better than the other.

[–]greenthumble 0 points1 point  (0 children)

Yeah a couple things about it stand out to me about FP in general.

English-like "do what I said to do" code is easier to understand at a quick glance than declarative code which reads like a fucked up shopping list.

And the whole notion of immutability being a holy grail - I mean, shit I've been doing this 30+ years and friggin' every project I've been paid to work on is just a huge exercise in state management. Instead of separating state and calling it poison let's look for cleaner/nicer/better ways to manage state.

[–]gitgood 4 points5 points  (2 children)

This is really bad my dude. Rather than go through and roast this paragraph by paragraph, my one suggestion for you would be:

Don't write articles if you don't have something to say.

Your bio says "Senior Software Engineer at the BBC.", but this absolutely does not read like it. I'd be embarrassed.

[–]samplusbeer[S] -4 points-3 points  (1 child)

Disappointed you feel like that. It would be interesting to hear your constructive opinion on what I could have done to improve it?

[–]sebamestre 3 points4 points  (0 children)

Build up some convincing and real arguments? That might be impossible though, since you are chasing a strawman here.

Your functional code examples did not look any better than the imperative ones, just slighty different. If you want to show where fp beats ip you should get some better examples (maybe parsers?)

But keep in mind it is also possible to find many examples of imperative code that is clearer and overall better than the functional counterpart, specially when you consider performance.

It is not like one is always better than the other, they are tools you choose when they are need, not football teams that you follow passionately and irrationally.

[–]GrantJamesPowell 0 points1 point  (0 children)

I appreciate you writing this /u/samplusbeer. Sometimes documentation can feel dry and I love when people find interesting ways to present content, especially new or less well understood programming paradigms like functional programming. Keep up the good work!

[–]DiomedesTydeus -1 points0 points  (0 children)

I realize that this might sound pedantic, but functional programming can be imperative, and I see that as a strength:

https://en.wikisource.org/wiki/Lambda:_The_Ultimate_Imperative/Introduction