Pencil Code: A Programming Primer
This elegant programming primer teaches K-12 students to code through more than 100 graded examples, each one illustrated in color. The second edition includes an appendix with a tutorial in CoffeeScript.
Written by a computer scientist to teach his own children to program, the book is designed for inductive learning. The illustrated programs come with no expository text. Instead, the sequence of projects introduce increasingly sophisticated concepts by example. Each one invites customization and exploration.
The book begins by suggesting a simple program to draw a line. Subsequent pages introduce core concepts in computer science: loops, functions, recursion, input and output, numbers and text, and data structures. The more advanced material introduces concepts in randomness, animation, HTML5, jQuery, networking, and artificial intelligence.