Found in 21 comments
by pmoriarty
2017-10-03
This reminds me of the style of The Little Schemer[1] which a lot of people love but which I found to be plodding and insufferably condescending.

[1] - https://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/0...


Original thread
by jarcane
2015-02-16
The classic systems were worlds ahead of most modern ones in one very important respect: documentation.

The Tandy/Radio Shack books for the Color Computer series (and it's astoundingly good LOGO implementation) were amazingly clear and concisely written with lots of examples, and because in those days even a disk drive wasn't a guarantee, all the examples were written to be hand-typed and experimented with.

There were even books in those days that aimed to teach kids machine language! [1]

That said, I think Djikstra and Felleisen may be slightly right about the long-term usefulness of old-fashioned BASIC and LOGO for learning, but there are a few books in modern languages that come close.

Hello World![2] was explicitly written to hearken back to those old manuals, by a father aiming to teach his 12-yo son programming with Python.

Land of Lisp[3] and Realm of Racket[4] also call to mind those old books as well, though they're targeting a bit older audience and have their quirks (LoL is a bit in-love with huge nested trees and a-lists in the examples, and Realm of Racket tends to gloss over a lot of the examples and expects you to just read the sample code rather than walking you through the process completely).

The Little Schemer[5] is also a fantastic little book that takes on the form almost of a set of brain-teasers, and teaches recursive thinking entirely by example and in methodical detail. The later chapters can be a bit stumpy, but if you go through the book step by step in regular sessions it builds on itself pretty well.

All of these are aiming at around the 12+ age range though, I don't think there's much out there anymore for anything younger.

[1] http://boingboing.net/2013/05/16/1983s-wonderful-introducti....

[2] http://www.amazon.com/Hello-World-Computer-Programming-Begin...

[3] http://www.amazon.com/Land-Lisp-Learn-Program-Game/dp/159327...

[4] http://www.amazon.com/Realm-Racket-Learn-Program-Game/dp/159...

[5] http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...


Original thread
by pash
2015-01-06
To understand the theory of recursive functions you must understand fixed points, but I think there's a simpler way to understand the magic of the Y combinator.

Here's how it works. Say we have a recursive function like map:

    map f [] = []  -- We'll ignore the base case since there's no recursion here
    map f (x:xs) = f x : map f xs  -- This is the interesting part
We want to write this more primitively, without explicit recursion. How can we do that? Well, if it's possible at all, we obviously need to get rid of the map on the right hand side of the second case.

How? Well, let's abstract over the recursive call, replacing it with a function that we'll add as parameter to our definition:

    map' _ f [] = []  -- Still boring
    map' g f (x:xs) = f x : g g f xs  -- Pay attention for later!
(Read map' as "map-prime", i.e., a variant of the definition of map.)

All we've done so far is replaced map' where it should be on the right-hand side of its own definition with g, and then added g as parameter of the function. We end up with a double g on the right-hand side because of that added parameter.

OK, now what? Well, we need somehow to make g be map', the thing we're defining. which means we need somehow to pass our definition of map' to itself, so that (in the second case) we'd end up with something that evaluates to:

    map' map' f (x:xs) = f x : map' map' f xs
Then the right hand side would obviously be right; it's what we were shooting for at the start (assuming we can get map' map' to equal map, which is what we're trying to do). The left hand side looks a little strange [0], but it's just saying that we need the first parameter of our definition to be the the thing we're defining.

So how do we make this happen? Well, what is map map f (x:xs)? It's map applied to itself, then to some other arguments we need. So the key, it seems, is to figure out how to apply map to itself. Well, in the lambda calculus that's pretty easy [1]:

    why f x y = f f x y
That is, why is just

    lambda f. lambda x. lambda y. (f f) x) y
OK, so fix takes a function and applies it to itself (after applying it first to arguments x and y). Great. That's what we needed. Now we can take our defintion of map' (the one marked Pay attention for later! above) and do this:

    map = why map'
And I've re-used the name map there because we can easily show that this definition is equivalent to our original definition of map by showing that it reduces to the same expression:

    map f (x:xs) = why map' f (x:xs)
      == (by def. of `why`)
    map' map' f (x:xs)
      == (by def. of `map'`
    f x : map' map' f xs
Which, if you keep expanding the expression map' map' f xs, you will see is indeed equal to the definition of map.

Voilà. So that wasn't too hard. It's basically two steps: (1) abstract over the recursive call, then (2) figure out how to pass the function you're defining to itself. If you look at the Y combinator, you'll see that that's exactly what's going on there.

If this didn't make a lot of sense to you, it's probably because I wrote it on my iPad at 4:30 in the morning. It really is just those two steps: abstract over the recursive call, then self-apply. ...

To get deeper into the recursive mindset (if you're not there yet) and to build up deliberately to the Y combinator, take a look at one of my favorite books on functional programming, The Little Schemer [2]. (And watch out for the jelly stains!)

------

0. And it's ill typed, but never mind that. It's not possible to define the Y combinator (or any other fixed-point combinator) in the simply typed-lambda calculus, so just imagine that my Haskell-style syntax is untyped, like the basic lambda calculus.

1. Although, again, there's no way to give fix a good type in the simply typed lambda calculus.

2. http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262...


Original thread
by baddox
2015-01-05
It's certainly possible to learn to "think recursively," and thus be able to work out recursive solutions to new problems in the same way that other people work out iterative solutions to new problems.

The book The Little Schemer is a great way to learn to think recursively. It has been 5 years since I read it, and I haven't kept the skill fresh, so I've probably lost most of it.

http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262...


Original thread
by evanspa
2014-11-07
I started my Lisp journey seeking to learn Clojure too. I starting out with The Little Schemer[1]. I chose Scheme so that I could first wrap my head around the basic Lisp syntax, along with the recursive and functional thinking. To keep things as simple as possible, I did 95% of the exercises using a composition notebook and pencil[2]. This kept the incidental complexity to a minimum.

Later, I moved on to the Clojure books. Working through the Little Schemer was invaluable (and its bibliography is excellent too).

[1] http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...

[2] https://github.com/evanspa/TheLittleSchemer/blob/master/sche...


Original thread
by clark-kent
2014-07-14
SCIP should always be in the list as one of the best programming books ever written. Others are 'Simply Scheme: An introduction to computer science', simply scheme is an alternative to "How to design Programs", http://htdp.org/, both books are written for non-programmers but they provide a gentle introduction to many advanced topics covered in SCIP. I prefer "Simply Scheme". Another one is the "Little Schemer" http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262....
Original thread
by jongold
2014-07-09
I really liked The Little Schemer[0]. The language/syntax is a little different to Clojure but it's broadly transferable; really helped me think functionally.

I'm a total noob with this stuff but I've been really happy with Clojure (and more recently ClojureScript/Om) :)

[0] http://www.amazon.co.uk/Little-Schemer-Daniel-P-Friedman/dp/...


Original thread
by baddox
2014-05-16
I recently went through the later chapters of The Little Schemer again. I still find it incredibly challenging and awesome. As many have said, this is a great book to teach you to think recursively.

http://www.ccs.neu.edu/home/matthias/BTLS/

http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262...


Original thread
by latj
2014-03-07
by hga
2013-07-01
Lots of terrific advice here, and I myself am mostly a self-taught programmer, I've only taken 3 formal courses, all introductory. I'd only add:

"Maybe I would be confident in my skills to apply to some tech jobs. Or do some freelance work"

Don't expect to get "normal" tech jobs by the time you're good enough unless you can disguise your age, age discrimination is fierce in this field. But as noted by you and many others, there are many options.

I'd also add that at some point unless you've forgotten all your math and don't want to refresh it try Structure and Interpretation of Computer Programs (SICP) (http://en.wikipedia.org/wiki/Structure_and_Interpretation_of..., http://ocw.mit.edu/courses/electrical-engineering-and-comput...), everything you need is free and online. If it's a good enough fit for you it will teach you some foundational things that'll make you a better all around programmer and system designer. E.g. one way or another learn big O notation (https://en.wikipedia.org/wiki/Big_O_notation) and its significance.

Over time, get some breath. In my book that means try to learn the basics of these languages and concepts and their typical environments: Lisp and recursion (see SICP above, or alternatives on the Wikpedia page plus http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262... specifically for recursion), C and pointers, HTML, Javascript and browser programming, and some database work, SQL/RDBMS preferred, I recommend PostgreSQL over any of the MySQL variants, but a simple key/value store or embedded SQL database would also get your feet wet. If you learn recursion and pointers you'll be way ahead of most people who believe themselves to be programmers.

Good luck!


Original thread
by baddox
2013-02-21
The Little Schemer is the book that got me thinking about data structures recursively (starting with linked lists), and that was later furthered by SICP.

http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...

http://mitpress.mit.edu/sicp/full-text/book/book.html


Original thread
by pearkes
2012-04-01
I've found The Little Schemer[1] to be very approachable and effective for grokking common CS concepts.

[1]: http://www.amazon.com/The-Little-Schemer-4th-Edition/dp/0262...


Original thread
by ericmoritz
2011-06-01
I found Erlang hard to understand at first but I was a victim of my own ignorance. I knew instantly that it's pattern matching feature was incredibly useful but it wasn't until I read "The Little Schemer" http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... that I was able "get" Erlang.
Original thread
by andjones
2011-04-19
It sounds like you're more interested in programming languages in general. You might find these books interesting:

Essentials of Programming Languages http://www.amazon.com/Essentials-Programming-Languages-Danie...

The Little Schemer http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...


Original thread
by stevelosh
2011-04-06
My vote goes for The Little Schemer. It's short (but don't read it all in one sitting), entertaining, and will teach you some important concepts.

http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...


Original thread
by parenthesis
2010-07-21
Two good books which are in the sort of style you seek are:

The Little Schemer <http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...; and

Clause and Effect <http://www.amazon.com/Clause-Effect-Programming-Working-Prog....

Also a help is that the languages they use ('use' is a more appropriate word here than 'teach') — Scheme and Prolog, respectively — are much more mathematical in nature than typical mainstream languages are.


Original thread
by sh1mmer
2010-05-03
I remember when I first read this a while back, and I wanted to read the little schemer too. It's now in 4th ed. (http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... - $22) but I really wish there was an e-version for my Kindle: PDF, anything.
Original thread
by samdk
2010-04-17
The Little Schemer is an updated version of The Little Lisper. It also happens to be much cheaper: http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...

It's an excellent introduction to thinking recursively. The others in the series (The Seasoned Schemer, The Reasoned Schemer) are worth reading too.


Original thread
by grinnbearit
2009-12-14
I personally find scheme to be the simplest Lisp to learn (after working with Common Lisp, Clojure and Scheme). If you do want to learn scheme, I found the MIT lectures http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Compute... brilliant and the little schemer http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02... a lot of fun as well.
Original thread
by steveeq1
2009-01-11
Might I make a recommendation? Start with "The Little Schemer" and then graduate to "The Seasoned Schemer". Here: http://www.amazon.com/Little-Schemer-Daniel-P-Friedman/dp/02...

It takes you more step-by-step than SICP and once you get more practice with those books, SICP will be much more paletable.


Original thread

Looking for a good book? Subscribe to the weekly newsletter.