How does one learn to code? Students in computer science and software engineering will have a few first-year programming courses, with the first one introducing basics like variables, control flow, and loops. Autodidact programmers probably started with a tutorial somewhere, but eventually got a book on the subject. Regardless of the learner’s path, we’re talking about a book that teaches “the basics.”
This is the table of contents I have in mind:
- math review (numbers, variables, functions, multi-step procedures)
- syntax and new type of objects (variables, functions, algorithms, int, float, list, dictionary, objects)
- Programming basics
- Control flow
- If elif else
- Structure of programs
- Binary search algorithm
- Sorting algorithms
- Graph algorithms
- Numeric algorithms
- Optimization algorithms
- Fancy scientific calculations made easy (SymPy, numpy)
- Automate info. processing tasks (bash scripting)
- Generating reporting and useful analytics from data (pandas)
- Creating websites (Django)
It’s not the standard set of topics for the “COMP101 textbook” category, but I bet with some thought put into it, it can be made to contain most of the material for a first-year coding class. We just godda make sure that profs will have enough to support teaching their class. Best of all it could all probably fit in 300 pages, and retail under $40. It could be even thinner, but would be better to have lots of exercises.
I’m thinking about this today because I was visiting McGill and had the chance to talk with the prof who taught my first-year programming course and we somehow got to the topic of textbooks. She remembered the computer science textbook she learned from, and described it as being very thin. So it can definitely be done.
The book described above doesn’t exist yet, but if you leave comments below telling me you want it, it will move up in the priority list…
UPDATE May 2021: I’ve received lots of requests for this book and started planning for it (collecting materials, scoping, and teaching programming basics). The plan for summer 2021 is to focus on No Bullshit Guide to Statistics, but programming with Python is next after that!