Incremental TypeScript: Future free introductory programming textbookK12In-Person
Less than nine years since its initial release, TypeScript has become the world’s third most popular programming language. A modern imperative language, TypeScript balances the pedagogical benefits of Python and Java, blending the simplicity and brevity of the former with the greater safety of the latter. Furthermore, its type system obviates many of JavaScript’s notorious papercuts, making it arguably easier to teach than its dynamically-typed cousin. Yet all presently-available TypeScript curricula miss this opportunity, exclusively targeting programmers already familiar with JavaScript.
The author recently completed the first four chapters of Incremental TypeScript, a forthcoming textbook for teaching TypeScript to the complete beginner, with an intended audience of high school– or college-level CS1 courses. The textbook takes an incremental approach: Each lesson intentionally centers around a single language construct and begins with a motivating example illustrating when it is the appropriate tool to use. Lessons frequently feature code with errors, using them to demonstrate the debugging process. After each lesson is a lab assignment where students apply what they have learned so far. The author has tested most of the lessons and labs by teaching a trimester-long introductory high school course using a direct port of the curriculum to Java.
So far, the draft textbook covers I/O, conditionals and Boolean logic, numbers and data types, and loops. Each of these chapters comprises four lessons and their associated code samples, libraries, and labs. The author plans to add additional chapters, beginning with one on functions, before eventually releasing a free e-book.