3 ms·
What's specifically functional about this advantage. Can't you encode the buisness logic into types in non-functional languages as well?
by Naac 7y ago
What's specifically functional about this advantage. Can't you encode the buisness logic into types in non-functional languages as well?
- eru 7y agoThe type systems that are common in functional languages are usually more flexible and useful than what you find in most other common languages (in particular, usually more useful than the type systems of common object oriented languages).
- hellofunk 7y agoThe word “type“ has a fairly different meaning in functional programming compared to object oriented programming. At a very shallow level, they have some similarities. But the way they are used is vastly different between the two paradigms.
- ativzzz 7y agoYou can encode it, but it is not enforced. For instance, I can refer to every instance/argument when I use a Person object as `person` or whatever name of the class is, but when you have many developers working on a large system, these things tend to slowly spiral unless you establish strict guidelines early on and enforce through code reviews. Or you can use types where it's enforced by the compiler.
- marcosdumay 7y agoOn practice, no you can't. At least today. But it may be a very interesting question for a researcher.