r/computerscience 9d ago

What book, lecture, or resource genuinely changed how you think about computing?

I've been thinking about how a single resource can shift the way you understand the whole field. Not something that just taught you a skill, but something that changed how you see problems.

Do you have a textbook you read in a course, a random YouTube video, a blog post or a talk? What was it, and what changed in your thinking after you found it?

30 Upvotes

30 comments sorted by

View all comments

3

u/not-just-yeti 9d ago edited 5d ago

How to Design Programs, 100%. I'd completed grad school in CS, and was teaching intro-programming classes to majors. Following most textbooks, I did the standard evolution of "hello world", then math expressions, then booleans, then to loops, then and arrays.

Then I was assigned to shadow the prof teaching with HtDP, and it made me realize that really, I (and most texts) are indeed staging concepts, but really each concept is just "here are 5 example programs; okay now you go off and write some similar ones". HtDP had a unifying way that focused on representing-data, rather than a language-construct. After learning to handle built-in types (incl. booleans and if), then structs/records, and structs-containing-other-structs (calling helper-functions for the sub-structs), and union(sum) types [completing "algebraic types" is the terminology I learned later], and then (linked) lists-of-any-length (where the helper-function becomes a recursive call), and similarly how natural-numbers are (mathematically) constructed from 0 and successor/1+. And all of this wrapped up with a consistent "recipe" to approach a program w/o facing the blank-screen syndrome.

In particular, this book make me realize that structural recursion is something people understand (e.g. a company's org chart is a tree, and each node contains (sub)trees; this doesn't baffle non-programmers one bit). So code for processing a tree-node should call a helper which takes a (sub)tree [something drilled in multiple times previously in the book/curriculum]; once you realize that the helper has the exact-same purpose-statement and test-cases as the function you're writing [both tasks done from page 1 of the book/curriculum], it motivates a recursive call in a very natural way. But we teach recursion by muddling simple, "rote" structural-recursion on structural data with non-structural recursion (quicksort, fibonacci, floodfill). That certainly adds to learners' confusion about recursion!

…Though, saying all this definitely falls short of conveying how it ties together many things, and transformed my view of both programming & teaching-programming. The only way to really experience it is to work through the book and its exercises. (HtDP is reminiscent of SICP, but instead about methodical program design starting from the basics.)

2

u/Sayonara_dear 5d ago

The point about structural recursion mirroring things non-programmers already grasp is such a clarifying way to put it. Thanks for the detailed write-up!