I heard that programs written in a functional language tend to scale better. Is this true and if so then what are the differences from non functional languages that cause this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Whoever you heard this from was most likely referring to the fact that “Disallowing side effects provides for referential transparency, which makes it easier to verify, optimize, and parallelize programs, and easier to write automated tools to perform those tasks.”
In other words, functional programs tend to not have side effects (modifying global state) so running many instances of a functional program in parallel should produce the same output. For example, consider the difference between
and
The second has no side-effects and can be run in parallel, provided you structure your code so that you provide all the necessary inputs.