Lisp 如何让我成为一名更好的 C# 开发人员?

发布于 2024-08-14 04:40:29 字数 1431 浏览 1 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

紙鸢 2024-08-21 04:40:29

为什么函数式编程很重要作者: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

还不是爱你 2024-08-21 04:40:29

我认为学习函数式语言所能获得的最大好处就是开始以一种更具声明性、更少命令性的方式思考。这将导致编写更具可读性、可维护性和可组合性的代码。

当你使用函数式时你学到的另一件事是纯函数的重要性,即没有副作用的函数。

而且由于 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.

何以畏孤独 2024-08-21 04:40:29

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.

帅气尐潴 2024-08-21 04:40:29

您应该学习 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.

故乡的云 2024-08-21 04:40:29

一方面,你可以从里到外学习递归。

For one thing, you can learn recursion inside and out.

梦纸 2024-08-21 04:40:29

学习Scheme 的一个很好的理由是它经常被用作一种教学语言。因此,有许多以Scheme 作为目标语言编写的优秀(学术)书籍和论文。

Google:

  • EOPL
  • SICP
  • HtDP
  • 小/经验丰富/理性的策划者

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:

  • EOPL
  • SICP
  • HtDP
  • Little/Seasoned/Reasoned Schemer
呆° 2024-08-21 04:40:29

只要学习它,然后惊讶地回来并告诉我们。

Just learn it and come back amazed and tell us about it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文