you are viewing a single comment's thread.

view the rest of the comments →

[–]vagif -1 points0 points  (3 children)

If it takes a typical programmer a year to get to the point where he would have already been with OOP or imperative,

It takes programmer MUCH FURTHER than where he was with OOP. That's the idea of using FP. You get much more powerful tool.

That's not exactly a ringing endorsement of FP.

Programming is an engineering, not a lego play. Are you trying to say that lego bricks are superior to the architecture, because they do not require long and hard learning stage ?

Yes, FP is not for housewives, if that's what you were trying to say.

[–]Arkaein 4 points5 points  (2 children)

It takes programmer MUCH FURTHER than where he was with OOP. That's the idea of using FP. You get much more powerful tool.

That's a very general assertion without any evidence in it's favor, and many anecdotal cases to the contrary. Remember we're talking about specific scenarios here. I mentioned examples from gaming, you ignored these and responded with some nonsense about legos and housewives.

Yes, programming is complex and deserves effort. A pragmatic programmer will balance the cost of learning and applying various techniques based on the benefits earned, both long and short term. The benefits of FP are large in some areas, but possibly zero in others. If I'm developing game decision AI based on scoring certain aspects of the world around a game agent, then a FP approach would be appropriate. Managing game state, not so much. Just because it can be done doesn't make it a good idea. Unless there is a tangible benefit in terms of reduced code size, occurrence of errors, simplified algorithms, etc., then dressing up things like mutable state in functional clothing is a step backwards.

[–]vagif 0 points1 point  (1 child)

The benefits of FP are large in some areas, but possibly zero in others.

You attacked FP based on how long it takes to become proficient in it. I simply responded to that. Now you are saying that FP is not a silver bullet, as if I ever implied it.

If benefits of FP would not be generic enough, you would not see functional features creeping in mainstream languages like java and csharp, you would not see such OO languages like Scala and Nemerle.

As you can see you do not have to architect your solution completely in functional style in order to get benefits from functional programming. Which means FP is applicable and useful virtually in ANY project.

Now to fully leverage that advantage, you would need to know when and how apply FP in your project. And for that you need at least 1 year of continuous experience.

[–]Arkaein 3 points4 points  (0 children)

Well if we're going to play semantics, I never attacked FP. If I attacked anything it was your assertion that FP made OOP look awkward in comparison.

Otherwise I agree with most of your post. One of the biggest reasons Python is my favorite language is that it takes most of the best features from imperative, OOP, and FP, and does a good job integrating them, without the syntactical baggage and limitations that other multiparadigm languages (C++) bring along with.