Functional languages like Erlang have the opposite philosophy. They try to minimize the context surrounding a piece of logic-- a function. All you have to know is what parameters a function takes and what it returns. There is no implicit link between the function and the data it uses. With single-assignment, you don't even have to worry about functions mangling the values of your variables. When you're coding in Erlang as opposed to Java, you think less about the context of your functions and more about what they do and how to compose them together to solve your problem.
yariv's blog 零星摘要
最新推荐文章于 2024-06-03 09:37:44 发布
本文探讨了函数式编程语言如Erlang的设计理念,强调通过最小化函数上下文来提高代码的可读性和可维护性。文章指出,在Erlang中,开发者更关注函数的功能及如何组合这些函数解决问题,而非函数所处的具体环境。
629

被折叠的 条评论
为什么被折叠?



