Principles, Best Practices and Design Patterns for functional programming

后端 未结 7 1644
我在风中等你
我在风中等你 2021-01-31 09:56

Are there any known principles, best-practices and design patterns that one can follow while writing code in a functional programming language?

7条回答
  •  情书的邮戳
    2021-01-31 10:29

    Don't follow principles, follow your nose. Keep functions short. Look for ways to reduce the amount of complexity in code, which often but not necessarily means the most concise code. Learn how to use the builtin higher order functions.

    Refactor and reduce the code size of a function right after you've written it. This saves time because tomorrow you won't already have the problem & solution in your mind.

提交回复
热议问题