3 ms·
I feel like I'm missing the punchline here somewhere. Functional programming "doesn't work" at 98% but if you turn some imaginary slider to 85% then everything
by icey 17y ago
I feel like I'm missing the punchline here somewhere. Functional programming "doesn't work" at 98% but if you turn some imaginary slider to 85% then everything is awesome? I honestly don't get this.
Can anyone shed some light on the WTF-ness of this article? (Other than the author disliking purely functional development and "98% functional" development, whatever that means).
- jacquesm 17y agoWhat's so hard to understand? I think he means that if you try to use functional programming as a religion and try to shoehorn everything into the functional paradigm (I hate that word) that you are making life hard on yourself. But by using the right mix of functional and imperative you get the best of both worlds. I don't necessarily agree with that but I have no problem understanding it. The more I learn about 'functional' programming the more I'm beginning to see that it is not so much a simple technique as it is a wholly different approach to solving the problems, which often leads to tremendous insights that in turn lead to huge optimization possibilities. Witness the 'hashlife' link that I posted last week, I never even thought such an optimization was even possible.
- steveklabnik 17y agoThe main problem I have is that pure is a binary condition. Functions are pure or are not. There's no '85% pure.' But that's really a wording issue, and not one with his argument. He's just saying that being purely functional is not worthwhile, 'just functional' is good enough.
- jacquesm 17y agoA function can be 100% pure but it doesn't have to live in a 100% functional program.
- steveklabnik 17y agoIt's true. But he's talking about the structure of programming languages, not functions. Like I said, it's a small wording issue, not a problem with his argument.
- icey 17y agoThe author explained that purely functional development is hard to do in his first posting. I don't understand the point of his follow-up; all he says is there's some magical barrier in which functional programming is suddenly okay, and that magical barrier is somewhere between 98% and 85% on the mystical "functional programming is hard, let's go shopping" scale.
- statictype 17y agoI don't know why you're taking his post so literally. Forget about the 98 and 85 numbers. The point of the follow-up was to merely say that functional programming works as long as you don't try to rigorously and dogmatically apply it to everything. There's a sweet spot where most of your code is functional but you also allow certain inconsistencies in, in order to make the whole system palatable. This was actually what he was trying to say in his first post, but he didn't really get it across clearly, hence, the follow-up.
- jrockway 17y agoThere is nothing to see here even when the light is on. The author makes a single example of something he thinks can only be solved impurely. Of course, it it trivial to solve purely. He just doesn't know how, and therefore functional programming sucks. If you only use the parts he knows about (the "85%" presumably), then everything is fine. Whenever I hear "functional programming sucks", it's from someone who doesn't know what functional programming is or how to do it. Whenever I hear "object oriented programming sucks", it's from someone who doesn't know what object oriented programming is or how to do it. Do you detect a pattern?
- gruseom 17y agoBait I can't resist! I know what object-oriented programming is and how to do it, and I say it sucks. "Sucks" isn't the word I'd have used, but it'll do. Of course you're free to disbelieve that I know how to do it. (I did program professionally in that style for years and did a lot of consulting/mentoring to teams in OO practices if that helps, not that it should.)