News for hackers. Stuff that matters.
Re:Why is learning functional programming so damned hard? (2... by taeric on Sunday August 15, 2021 @11:55AM (#28189760)
This somewhat annoys me. "Knowing what you are doing" is time efficient. Regardless of what tooling you have.
Re:Why is learning functional programming so damned hard? (2... by brightball on Sunday August 15, 2021 @12:30PM (#28190085)
The flip side is maintainability, which gets much simpler long term with FP.
Re:Why is learning functional programming so damned hard? (2... by hvs on Sunday August 15, 2021 @04:51PM (#28192428)
This is a statement that requires some sort of citation. Extraordinary claims and all that.
Re:Why is learning functional programming so damned hard? (2... by brightball on Monday August 16, 2021 @09:04AM (#28197542)
20 years experience with OO code. Over time, OO always leads to entanglement due to inheritance based solutions that seemed like a good idea at the time. Eventually, these become the basis for many other parts of the system.

You combine the potential for side effects in the code with a tree that can't easily be changed because of how many other things it will negatively affect and you end up with a code base that is harder and harder to change the larger it gets.

In a FP approach, this is a class of problems that you can't easily replicate. Yes there's a learning curve to operating in a FP style, but once you're able to move quickly with it the long term rewards are a byproduct.

The OO solution to avoiding this problem is to build with microservices instead, which forces different parts of the system to be isolated and minimizes the negative effects from entanglement...but microservices come with their own maintenance and speed of development headaches as well.

Re:Why is learning functional programming so damned hard? (2... by mbrodersen on Tuesday August 17, 2021 @12:07AM (#28206135)
35 years of OO experience here. Maintaining very large C++ code bases. I never have OO entanglement problems due to inheritance based solutions. Why? Because I only use inheritance for interfaces. Nothing else.
Re:Why is learning functional programming so damned hard? (2... by taeric on Sunday August 15, 2021 @02:02PM (#28190816)
Do you have evidence showing this? The few long term maintained programs I am aware of are decidedly not what one would call modern functional.

(Granted, the most ported and maintained software I know of is either Linux or SCUMM.)

Re:Why is learning functional programming so damned hard? (2... by wyager on Sunday August 15, 2021 @01:44PM (#28190663)
I know what I’m doing in many languages, and I’m uniformly more productive with the FP ones. The only time I’ll reach for a non-FP language is if I’m forced to for work or if I’m working on an embedded system with no allocator.
Re:Why is learning functional programming so damned hard? (2... by taeric on Sunday August 15, 2021 @02:04PM (#28190833)
Is this confirmation/survivor bias, though?

I would love to know that there is a panacea that automatically improves productivity. Unfortunately, I haven't seen one in my career, as yet.

I am certainly more happy in many functional languages. And I can see happiness contributing to some. But I can't count that as data, without RCTs or something similar.

I'm not going to go so far as to claim that computer science isn't science. But I do fear that there are more claims than there are checks in our industry.

Re:Why is learning functional programming so damned hard? (2... by m_arnold on Monday August 16, 2021 @12:49PM (#28200131)
>I would love to know that there is a panacea that automatically improves productivity. Unfortunately, I haven't seen one in my career, as yet.

I suspect you've seen many of them. They're just the ones that are so normal you don't notice anymore. For instance, no one does pure waterfall-style project management anymore. "goto" programming has completely dissappeared. Etc.

Re:Why is learning functional programming so damned hard? (2... by fulafel on Monday August 23, 2021 @10:10AM (#28275968)
What are your criteria for qualifying as automatic productivity improvement? Would garbage collection vs manual memory management count?
Re:Why is learning functional programming so damned hard? (2... by wyager on Sunday August 15, 2021 @04:23PM (#28192184)
I wouldn’t say it “automatically improves productivity” - I suspect it might be limited to more intelligent and/or mathematically inclined programmers. That said, I think for many programmers not using it is a huge and pointless missed opportunity. This is one of those visibly high-return arbitrages that it pains me to see go unexploited.
Re:Why is learning functional programming so damned hard? (2... by taeric on Sunday August 15, 2021 @04:32PM (#28192259)
I certainly don't want my criticism to be a call to avoid functional programming. I just get an uneasy feeling when I see it over sold, as well.
Re:Why is learning functional programming so damned hard? (2... by js4ever on Monday August 16, 2021 @01:19AM (#28195148)
"mathematically inclined programmers." This kind of programmers are literally the worst I met in 25 years of carreer. They are underperforming very badly compared to others.
Re:Why is learning functional programming so damned hard? (2... by wyager on Monday August 16, 2021 @12:04PM (#28199618)
Based on your username I’m guessing you’re a web dev programmer of some kind? I wouldn’t expect that to match well with math-oriented people.
Re:Why is learning functional programming so damned hard? (2... by js4ever on Monday August 16, 2021 @04:39PM (#28202655)
In fact I worked mainly with java and .NET C# in the past 2 decades ... Now I'm more into Node and Javascript ... I worked mainly in finance, banks and insurances. This is where I met all those underperforming math-oriented peoples. Most of the time they where not able to find a job in their field and went to programming as a way to earn money, not by passion like ALL the best engineers I met.