I think the best you can gain from studying a functional language is starting to think in a more declarative, less imperative way. That will lead to writing more readable, maintainable and composable code.
Another thing you learn when you go functional is the importance of pure functions, i.e functions without side-effects.
And because C# has been getting more and more functional and declarative features like closures (aka lambdas) and LINQ, you can understand programming with those constructs better. I had no trouble understanding deferred execution, the most common LINQ pitfall, because I already grokked Haskell, a lazy-evaluated functional language.
您应该学习 Lisp,以便了解元编程的强大功能。如果您还没有这样做,您应该学习使用 Emacs 并尝试编写一些Emacs Lisp。之后,尝试使用 Common Lisp -lisp.net/project/slime/" rel="nofollow noreferrer">SLIME。
You should learn Lisp so that you can understand the power of metaprogramming. If you haven't already done so, you should learn to use Emacs and try writing some Emacs Lisp. After that, try moving onto programming Common Lisp using SLIME.
One good reason for learning Scheme is that it is often used as a pedagogical language. As a result, there are many good (academic) books and papers available written with Scheme as the target language.
发布评论
评论(7)
为什么函数式编程很重要作者:John Hughes
http://www.cs.chalmers.se/~rjmh/Papers/ Whyfp.html
击败保罗·格雷厄姆的平均水平
http://www.paulgraham.com/avg.html
Why Functional Programming Matters by John Hughes
http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html
Beating the Averages by Paul Graham
http://www.paulgraham.com/avg.html
我认为学习函数式语言所能获得的最大好处就是开始以一种更具声明性、更少命令性的方式思考。这将导致编写更具可读性、可维护性和可组合性的代码。
当你使用函数式时你学到的另一件事是纯函数的重要性,即没有副作用的函数。
而且由于 C# 已经获得了越来越多的函数式和声明性功能,例如闭包(又名 lambda)和 LINQ,因此您可以更好地理解使用这些构造进行编程。我毫不费力地理解延迟执行,这是最常见的 LINQ 陷阱,因为我已经掌握了 Haskell,一种惰性求值的函数式语言。
I think the best you can gain from studying a functional language is starting to think in a more declarative, less imperative way. That will lead to writing more readable, maintainable and composable code.
Another thing you learn when you go functional is the importance of pure functions, i.e functions without side-effects.
And because C# has been getting more and more functional and declarative features like closures (aka lambdas) and LINQ, you can understand programming with those constructs better. I had no trouble understanding deferred execution, the most common LINQ pitfall, because I already grokked Haskell, a lazy-evaluated functional language.
Joel 几年前写了一篇文章关于程序员除了 Java 之外什么都懂,以及为什么会这样做学习像Scheme这样的东西是个好主意。我认为这些论点也适用于 C#。另一个很好的理由是,有一本关于编程的非常好的书,Abelson 和Sussman,它使用Scheme,可以让你对不同的编程概念有很多新的见解。
Joel wrote an essay some years ago about programmers knowing anything but Java , and why it would be a good idea to learn something like Scheme. I think those arguments go for C# as well. Another good reason is that there is a really good book about programming, 'Structure and interpreation of computer programs' by Abelson and Sussman, which uses Scheme and can give you a lot of new insights into different programming concepts.
您应该学习 Lisp,以便了解元编程的强大功能。如果您还没有这样做,您应该学习使用 Emacs 并尝试编写一些Emacs Lisp。之后,尝试使用 Common Lisp -lisp.net/project/slime/" rel="nofollow noreferrer">SLIME。
You should learn Lisp so that you can understand the power of metaprogramming. If you haven't already done so, you should learn to use Emacs and try writing some Emacs Lisp. After that, try moving onto programming Common Lisp using SLIME.
一方面,你可以从里到外学习递归。
For one thing, you can learn recursion inside and out.
学习Scheme 的一个很好的理由是它经常被用作一种教学语言。因此,有许多以Scheme 作为目标语言编写的优秀(学术)书籍和论文。
Google:
One good reason for learning Scheme is that it is often used as a pedagogical language. As a result, there are many good (academic) books and papers available written with Scheme as the target language.
Google:
只要学习它,然后惊讶地回来并告诉我们。
Just learn it and come back amazed and tell us about it.