4 ms·
I don't understand. What's the point? If you really want to do function programming, use a language made for it, like Haskell or OCaml. Why the need to make one
by goatlover 10y ago
I don't understand. What's the point? If you really want to do function programming, use a language made for it, like Haskell or OCaml. Why the need to make one language do everything. Whatever happened to using the right tool?
- blub 10y agoMulti-paradigm languages like C++ (or C#, Swift, etc) are the right tool because they allow you to use different solutions depending on the project you're working on. As you can probably tell, languages that support one paradigm aren't particularly successful. This is painfully clear in the case of F#.
- enricosada 10y agoJust curious, what are the pain points of F#?
- HelloNurse 10y agoThis is a direct demonstration that C++ is the right tool. Most good modern programming languages have sufficiently convenient syntax (in C++, function types, templates and lambdas/closures) and sufficiently advanced libraries (like the set implementation the article relies on) to allow a functional programming style, which mostly means, like in the linked article, read-only data structures and higher order functions. For an established C++ or Python programmer, being able to "make one language do everything" is great and functional programming style is "the right tool" for some specific needs. Preferring certain "pure" languages for the purpose of doing functional programming, regardless of the domain, can be an interesting experiment but is completely backwards from a practical engineering point of view.
- AnimalMuppet 10y ago> This is a direct demonstration that C++ is the right tool. Well, it's a demonstration that C++ can be made into an adequate tool. The right tool? That might be a bit of an overstatement...
- gumby 10y agoConsider why you might want a functional approach in the first place: perhaps you have a large dataset to manage and want to use an approach that minimizes the amount of garbage you generate. Or maybe you have a major algorithm that is simply easier to express and maintain in a functional style. But it's part of a larger project. That project could have other constraints that make C++ a better choice (or it could be an existing codebase).
- AnimalMuppet 10y agoThe amount of garbage you generate isn't a big reason to use functional in C++...