tags:

views:

504

answers:

7

I'm considering learning a Lisp dialect (probably Scheme, since I am constantly hearing how good of a learning language it is) in order to improve my general programming skill.

Apart from the fact that learning any new language helps you to be a better programmer in general, how can learning Lisp make me a better C# programmer?

+2  A: 

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

Steven Sudit
Don't you mean inside and inside again? :)
Iceman
@Kevin: To me that sentence feels more iterative ("and", "again") than recursive. I would say "recursion inside recursion" or something.
Martinho Fernandes
Well, for Lisp, it really ought to be tail-end recursion, and I'm at a loss as to how to demonstrate this by example in English.
Steven Sudit
+11  A: 

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

Robert Harvey
+8  A: 

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.

Martinho Fernandes
it'll even make you better equipped to work with databases
just somebody
@somebody: yes, that's a benefit. Because SQL is a declarative language, it helps to think declaratively.
Martinho Fernandes
I was writing up my own answer, but it's basically "What Martinho said above". Writing declaratively, writing functionally -- Lisp will give you an outside perspective on why these are good things. Not just "functional programming styles are easier to test", but "wow, look at how much shorter and more extensible my program is because it's data driven, or because key logic can be passed in as a parameter". As you said, C# has been gaining features which make it easier to work this way. Lisp may show you why you care.
khedron
I'm accepting this one rather than the highest voted (at time of writing) because it answers the question succinctly without just referring me to other sources (which I do still appreciate).
Erik Forbes
+1  A: 

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
z5h
+2  A: 

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.

Doc Brown
+1  A: 

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

Kugel
+4  A: 

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.

Luke Girvin
Voted up, bit I say go for Scheme, instead of Common Lisp. ;) I believe there are a few implementations of scheme that support the CLR, which might be good for the original poster.
Jonathan Arkell