Conditions of Use
This is a pretty complete, self-contained introduction to programming, using Raku as the programming language. It starts from the very basics, assuming no knowledge of programming (variables, control flow, etc.), and continues up through... read more
This is a pretty complete, self-contained introduction to programming, using Raku as the programming language. It starts from the very basics, assuming no knowledge of programming (variables, control flow, etc.), and continues up through intermediate features like object oriented programming, ending with fairly advanced, Raku-specific features like the language-level grammar system. There are some case studies interspersed, which further dig into practical issues like how to select a data structure for your task (Chapter 11).
It's written by an expert in the Raku language, and I didn't encounter any errors.
To my understanding, Raku is now a fairly stable language, so the book shouldn't become obsolete very quickly. There's perhaps a larger question of the extent to which Raku itself remains relevant, given its fairly small user base, but that is beyond the scope of this book.
Written in a friendly, conversational tone, and every chapter has a helpful glossary summarizing the technical terms introduced in that chapter.
Did not notice any consistency problems.
At the top level, the book is divided into two main sections: Part I is a comprehensive introduction to programming, using Raku, while Part II focuses on some more advanced features, many of them specific to Raku. The second part could be used on its own by someone already familiar with programming, to learn more about Raku-specific features, although I don't believe that is a primary intent of the book. Within Part I, the book is nicely modular but does have a "cumulative" style, where chapters will build on previous material, so is best read in order rather than picking and choosing chapters.
Generally well organized, no real complaints. Part II is a little more of a grab-bag of material, but that is difficult to avoid.
The book is nicely typeset in LaTeX, with clear conventions for displaying code snippets, etc. Also good use PDF hyperlinking for references and the index.
No grammatical issues.
No cultural insensitivity or anything of that sort. The examples are perhaps slightly dry (a lot of basic mathematical operations), but not unusually so for an intro programming book.
This is a somewhat unusual book: An introduction to programming for novice programmers, but using a language, Raku, that is an uncommon choice for introductory programming classes. Most CS-101 classes as of this writing (2023) use Python, and indeed this book started as an adaptation of a similarly titled open-access textbook, "Think Python", but using Raku as the language instead. So what one thinks of this book will largely depend on what one thinks of that choice. Given the choice, however, it's a very well written book! The use of Raku does allow for some fairly advanced material to be encountered without too much ceremony, since Raku tends towards being concise, with a lot of built-in functionality and less boilerplate than many languages. A potential classroom user might want to compare it with "Think Python" and consider the similarities and differences between the presentation of intro programming in the two languages.
Table of Contents
I Starting with the Basics
- 1 The way of the program
- 2 Variables, Expressions and Statements
- 3 Functions
- 4 Loops, Conditionals and Recursion
- 5 Fruitful Subroutines
- 6 Iteration
- 7 Strings
- 8 Case study: Word Play
- 9 Arrays and Lists
- 10 Hashes
- 11 Case study: Data Structure Selection
II Moving Forward
- 12 Classes and Objects
- 13 Regexes and Grammar
- 14 Functional Programming in Raku
- 15 Some Final Advice
About the Book
The title of this book was originally Think Perl 6, but since Perl 6 has been renamed Raku, we have also changed the title of the book.
Think Raku is an introduction to computer science and programming intended for people with little or no experience.
This aim of this book is not primarily to teach Raku, but instead to teach the art of programming, using the Raku language. After having completed this book, you should hopefully be able to write programs to solve relatively difficult problems in Raku, but my main aim is to teach computer science, software programming, and problem solving rather than solely to teach the Raku language itself.
Think Raku is a free book available under a Creative Commons license. Readers are free to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material.
About the Contributors
Allen Downey, Professor of Computer Science at Olin College in Needham MA, and the author of Think Python, Think Bayes, Think Stats and other books related to computer science and data science.