views:

413

answers:

6

From the reviews 'The Little Schemer' looks like the book to learn functional programming techniques and theory/reasoning. I wanted to ask if this book requires me to learn basic Scheme first? or I can get the hang of it in the middle?

Some background about myself to give depth to my question: I'm planning to have a crack at this book, however I am from an imperative background (Java guy) and am midway through Scala but I think that I haven't established a mind that embraces Functional Programming (I'm writing Scala in an imperative way). Will this book enlighten me in the right way?

+1  A: 

This is a very quirky book. I would strongly advise having a look at it in a bookstore before buying, to see if it really appeals - I've read it all, it didn't do a lot for me. But as for prerequisites - none really, you are told as much about Scheme as you need to know (which isn't much) in the text of the book.

anon
so you won't recommend it for learning the FP paradigm?
Monis Iqbal
@Monis It didn't do it for me. But then I've never read a book on FP I could whole-heartedly recommend. It's an interesting read if, like me, you are into different styles of writing teaching and training texts.
anon
Sure Neil, please recommend the other book. Thanks
Monis Iqbal
@Monis You misread me - I don't have a recommendation.
anon
+3  A: 

"The Little Schemer" is a book to help you learn the Scheme dialect of LISP.

To learn functional programming techniques and theory/reasoning, in LISP, you want to read Abelson & Sussman "Structure and Interpetation of Computer Programs".

Abelson & Sussman was originally written for MIT freshmen. You should be able to handle it. Be warned: it WILL twist your head in interesting directions.

John R. Strohm
Scheme is not a dialect of LISP.
anon
@Neil: How do you figure?
John R. Strohm
The same way I figure that C++ is not a dialect of C. The two languages are very different - c.f. the scoping rules differences between Scheme and LISP, for example. It's also quite amusing (but entirely expected) that the answer that gets upvoted is the one that doesn't answer the question.
anon
@Neil Butterworth: Scheme absolutely is a dialect of LISP. It's one of the main ones, the other being Common LISP. See http://en.wikipedia.org/wiki/History_of_the_Scheme_programming_language for the history of Scheme. In particular "Scheme is a dialect of Lisp but Lisp has evolved; the Lisp dialects from which Scheme evolved—although they were in the mainstream at the time—were quite different from any modern Lisp."
Jason
@Neil Butterworth: That's a straw man; I don't think anyone would consider C++ a dialect of C. Agree regarding the answer not answering the question.
Jason
from SICP, page 3: "The dialect of LISP used in this book is called Scheme."
Isaac Cambron
@Neil, C++ is like a federation of languages (Scott Meyers *Effective C++*, Item 1) which includes C, but Scheme is definitely a dialect of LISP.
Nick D
I find SCIP being very (maybe too much) oriented on meta-programming, which is not really as essential aspect of functional programming (e.g. in Haskell, F#, Scala) or is achieved in a completely different way. But the book is great and you'll learn many important programming concepts.
Tomas Petricek
+4  A: 

The Little Schemer doesn't assume any knowledge of Scheme going in. As with most efforts at learning a new programming paradigm, it might be helpful to find a good forum (maybe this one) where you can ask questions as they arise.

Noah
A: 

No prerequisites needed. It is book for beginners, and uses a very small subset of the language and explains it.

zaharpopov
+9  A: 

From the preface of the book:

What You Need to Know to Read This Book

The reader must be comfortable reading English, recognizing numbers, and counting.

I agree with this; it's a book that was meant for beginners. The book is quite informal and teaches the concepts (mainly recursion) and the syntax that you need to know.

The book is a true joy.

Jason
I read about the emphasis on recursion too. But is there enough emphasis on closures, currying etc?
Monis Iqbal
@Monis Iqbal: No, there is barely a passing mention of each.
Jason
+5  A: 

I think the main prerequisites are:

  • You must be able to learn from the authors' very dialectical style.

  • You must have a high tolerance for cutsie-pie examples.

There are no real programming prerequisites, but the book is written in a highly idiomatic style that is very definitely not for everyone.

Will this book enlighten me in the right way?

If you can learn from dialogs, and if you can handle the tone, then the book will help you make a good start. But tf you want to be "enlightened in the right way" about functional programming there are very good alternatives worth considering:

  • How to Design Programs is functional programming for the complete beginner using Scheme. A very good book, but perhaps too low-level for you. Free online and comes with superb free tools.

Given that you are already familiar with Java and therefore with static type-checking, you might consider Haskell as an alternatives:

  • Graham Hutton's Programming in Haskell is not available free, but it is an introductory book and a very fine one. You get the point of view of one of the world's best (and most well organized and clear-thinking) functional programmers.

  • If you want to go on your own, you could try teaching yourself Haskell starting with Why Functional Programming Matters by John Hughes and continuing with Real World Haskell, which is also free online.

Norman Ramsey
@Norman thanks for the detailed reply and for the recommendations.I think your answer is the best as far as I'm personally concerned, however I'm marking Jason's answer as the right one because it is concise in terms of the general public reading this question and secondly it has the most votes.Thanks again,Monis
Monis Iqbal