5 ms·
> Another issue is that the problems FP solves are problems that I think many developers genuinely don't have. Here's the one billion dollar question. Which is
by hcarvalhoalves 11y ago
> Another issue is that the problems FP solves are problems that I think many developers genuinely don't have.
Here's the one billion dollar question. Which is harder?
1) Correct code
2) Fast code
- contravariant 11y agoNeither of those two are particularly difficult.
- nostrademons 11y agoYou forgot a couple options: 3) Available code 4) Familiar code The history of the software industry has basically been 40 years of customers choosing code that exists, solves their problem right now, and doesn't make them think too hard about how to use it. They choose this over correct code (hence, Microsoft) and over fast code (hence, Python/Ruby/Javascript/PHP). FP actually helps you write both fast and correct code. The problem is that it requires a good deal more planning up-front and more effort to change things when requirements change. This has usually been a non-starter with the majority of customers: they want software that does what they need it to do, right now, and will continue to do what they need it to if they change their mind. If it screws up occasionally or makes people wait, that's okay, it's still faster & more accurate than a human is.
- pklausler 11y agoSlow is way faster than wrong.
- bunderbunder 11y agoI think you're also trying to imply that it's inherently more difficult to write correct code in imperative style. TBH, I'm not convinced this is the case for most developers. You can't just look at what fans of functional programming say. That's a self-selected group, so you're dealing with an observation that may be biased for any number of reasons. The closest I've come to seeing an objective comparison was when I was TAing intro CS classes in undergrad, so I had the opportunity to see the same people have to use both. In that case, it seemed to me like folks had difficulty writing correct code regardless of paradigm. The difference was, with the imperative language you'd see a lot of mostly-working code with a few bugs. With the functional one you'd see a lot of failing to even get off the ground. If we assume, for the sake of argument, that that's a reasonable characterization of what the typical person experiences when they try FP, is it really any surprise that it's not more popular? Nobody wants to work in a language that makes them feel frustrated and/or stupid. And you're not sweetening the deal at all when you insult them by implying that their code is inherently buggy because of the language they use.