Learning Functional Programming

24/01/2024

About a year ago I started trying to independently learn functional programming and programming language theory, and in the process, found some excellent resources on the web to share:

Programming Languages with Dan Grossman

This is a very good academic course on programming language theory, free to audit (which includes access to the autograder and exams) on Coursera. It’s divided into 3 parts: Part A using ML, Part B using Racket, and Part C using Ruby. The goal at the end of the course is to have a concept of the fundamental differences and similarities in the way that programming languages are structured / function. The instructor, Dan, teaches this same course in person at the University of Washington to 2nd or 3rd year undergraduate computer science students, and has more resources on his website. From the videos, he has a personable teaching style and is concerned with the bigger picture.

I’m currently working through part B, and have found the course challenging but do-able. I got stuck halfway through part A, and needed to brush up on recursion and functional thinking before I could progress with the course, which led me to the next resource:

The Little Schemer by Daniel P. Friedman and Matthias Felleisen

Drawing from Little Schemer by Duane Bibby

This is a very engaging, cute, tricky book that uses Scheme, cartoon elephants, and constant food references to teach from recursion, to higher order functions, to even deriving the Y-combinator in the dreaded Chapter 9. The Little Schemer, however, doesn’t burden you with the names of any of these concepts, and contains chapters like “* Oh My Gawd *: It’s Full of Stars” and “Shadows.” I worked through this book to get un-stuck in the course above, and after I finished this book I was completely unstuck, even a bit over-prepared.

If you look at the pages of the book, you’ll see that it has a unique format consisting of two columns: a column of leading questions on the left hand side of the page, and a column of answers on the right. The way to read it is to cover the answers column and try and answer the questions one by one. Each question builds on the knowledge you gain from answering the previous questions. The question-and-answer format uses pattern recognition and humor to facilitate learning, which was fun and satisfying for me.

I believe this format / style is based in constructionist learning theory (not to be confused with constructivist learning theory?), which was an educational movement pioneered in the 70’s by Seymour Papert and others at MIT - The Little Schemer was originally published in 1974 by MIT Press, as “The Little LISPer.” It has a sequel, The Seasoned Schemer, and there are at least 5 other books in the series on different programming topics / languages.

More Resources:

Here are some more great resources I’ve started looking at but haven’t gotten deeply into yet:

Functional Programming Principles in Scala with Martin Odersky

- a course taught by the creator of Scala! This course is the first in a series of 5 that make up the Scala specialization on Coursera.

Functional JS by Krzysztof Czernek

- a 7-part guide to functional JavaScript

Types and Programming Languages by Benjamin C. Pierce

- I really liked what i read in the introduction to this book; I can tell it’s going to be good. The author recommends having some background knowledge in basic set theory, so I started to read Naive Set Theory as a prerequisite, then got side tracked.

Naive Set Theory by Paul Halmos

- this is an undergraduate math textbook from 1960 introducing set theory. The author has a good sense of humor and the chapters are nice and short. Chapter 2 ends with Russell's paradox. I was astonished, stopped reading to contemplate the universe for a while, and forgot to finish the book!
🠜⭪ HOME 🠜⭪ SITEMAP