Anyone successfully approached this with computer programming? It’s a subject I think I have reason to believe I would be talented at (I have exhibited strong aptitude for mathematics and languages), but I don’t see a good path forward on working at it, so I learn other things. I think the “how” book might be something like codeacademy or khanacademy, but how about the “what” book or the “why” book?
How to Design Programs (HtDP) might be a good “How” book.
SICP is a “Why” book, one of the few timeless texts on the topic. It’s subsumed by studying any healthy functional programming language to a sufficient extent (idiomatic use of control operator libraries, not just syntax), but it’s more straightforward to start with reading the book.
Videos of the lectures that go with that book are also freely available online. I remember seeing two different versions.
Installing MIT Scheme might be an obstacle for someone new to computer programming. It might be easier to start by installing DrRacket and the SICP Collections.
Composing Programs might also be worth mentioning. It’s a Python-based textbook in the spirit of SICP and covers some of the same ground in a more approachable way, but perhaps in less depth.
Petzold’s CODE might be another good “Why” book. Its focus is a little more on computer architecture than programming per se, but that’s an important topic for programmers to understand. It’s a pretty easy read. I’d call it more of a pop book than a textbook, but it still covers important concepts. If you’re looking to learn programming, I’d highly recommend reading it.
<3 that book.
For programming, I think starting with a project and using that to decide what books to read my work best. Assuming you want to learn to program rather than learn Computer Science, the books that will be helpful will depend highly on the area in which you’re interested.
Do you just generally want to see if you’ll be good at programming? Even if so, is there a specific area which you’d be interested in writing a program, e.g. an operating system, a server, a web app, etc.?
I agree with the comment below that SICP is a good “Why” book but did want to note that I personally didn’t find SICP nearly as enlightening when I started programming as many others seem to. I’ve gone back to it since and loved it, but it definitely was not the thing that motivated me to practice programming a lot. Like everything else, it depends on your personality.
The 3 books technique includes a project or practice.
Whoops, will edit my comment to reflect that.
Other than suspecting I may have an aptitude, my interest in computer programming is driven by finding two fields cool and fun sounding: data science and applications of blockchain technology to stuff like verifying carbon sequestration and other changes in reality. Quite a bit of social science I deeply admire has been done using data science, and I have a couple of friends working to improve the world using blockchain technologies whom I also admire. I want to see if I am good at programming to see if I can participate in these endeavors I admire—or at least use my skills as a wordsmith and communicator to aid such endeavors.
If it is relevant, my own background is in social sciences and math.
Thank you so much for all your advice. You guys are awesome. Like An1lam and Mr.-hire point out though, I would actually need a project to work on. A practical, immediate application makes skills learnable much faster. Any advice on that?
Try making a simple video game. Think Tetris, not Skyrim. I personally made variants of Pong, Joust, and Asteroids when I was learning programming. You can learn a lot from making video games because it requires a variety of programming techniques. You need to understand basic algorithms, some mathematics, and you can’t be too inefficient about it or you’ll notice performance problems. And seeing your little world come to life is very motivating. This kind of thing is not terribly difficult to do in Python or Racket.
Note that many of the textbooks we’ve been recommending include exercises. Some of the more difficult ones count as small projects.
Concepts, Techniques, and Models of Computer Programming (CTM) is another good “Why” book.
Introduction to Algorithms (CLRS) might be a good “What” book. [Edit: I’m no longer confident this fits into the “what” category.]
I think CLRS is a pretty questionable book for someone who hasn’t programmed. I don’t think it’s great as a reference for writing algorithms, e.g. I think internet searching will often help you find better resources. And in terms of a straight read-through, it’s one of the more theoretical algorithms texts, and a large fraction of its exercises are proofs.
If the OP is interested in an algorithms book but has never done any programming or CS, I’d recommend The Algorithm Design Manual (which I’ve read much of and done a decent number of exercises) or Jeff Erickson’s free algorithms book (which I’ve read sections of and been impressed by).