8 ms·
How I Read Programming Books
- kylemaxwell 14y agoThe "typing code out" is important. A lot of us learned just this way in the early 80s, because that was the only way we could get the source: buy a magazine or a book that taught, say, game programming in BASIC, and then type in code. The inevitable syntax errors made you spend time going back through to figure out what you did wrong, not to mention the time you spent actually looking at each line. Downloading the code from a book's web site has nowhere near the same effect, even if it "feels" more efficient.
- uriloran 14y agoJep, you are absolutely right. If you type everything for yourself you remember and understand everything a notch better too. If you just copy & paste you won't really look at the code...
- natep 14y agoI try to do the same thing in lectures. Unless I'm late or the lecturer is a particularly fast talker, I can usually process the information to the point where I'm writing my current understanding in my own words. Much better for me than taking dictation for an hour.
- bornhuetter 14y ago> I can usually process the information to the point where I'm writing my current understanding in my own words. Can you explain what you mean by this?
- Swizec 14y agoHe means he's taking notes. Rather than painstaikingly writing down everything the lecturer says. Which would be stupid anyway, that's what audio recorders are for.
- nicholassmith 14y agoThis is pretty much how I use them as well, but I also intersperse personal projects in between using what I've learnt and trying to acquire new information as well. It's effective for me, I seem to retain more information this way rather than going for one pass through a book.
- pcote 14y ago"Do the exercises" is only something you can do if you have the book. Learning from blog tutorials don't usually have that benefit. You could still use this person's approach but you'd have to substitute in something for step 3. I'd say some kind of "mini-project" makes an acceptable substitute in most cases.
- mikevm 14y ago3 full reads of a book? That's highly inefficient, and it probably becomes very boring (at least for me -- but that might be my ADHD).
- S4M 14y agoI agree, it's not uncommon for a programming book to be 600 pages long. I wonder what book the OP is reading.
- kyrra 14y agoIt depends on your learning style. If you know any trained psychologists, they may have more to say on this, but I found a decent little article on it [1]. Reading a book 3 times and processing it differently each time probably is engaging a number of different memorization tips. [1] http://psychcentral.com/blog/archives/2010/09/03/8-tips-for-improving-your-memory/ http://psychcentral.com/blog/archives/2010/09/03/8-tips-for-...
- mikevm 14y agoI'm not gonna argue that repeating something is going to aid memorization, but in my experience, the best way to learn a programming language is to read a book and then actually use it. If you forget things you can always look them up, but re-reading the book 2 more times is useless.
- netmare 14y agoYes, three full reads sound too much. I usually just skim it fast, then do a full read, noting interesting or hard to understand stuff. Finally I use my notes when I need to refresh my memory or to try to comprehend the more difficult concepts.
- xentronium 14y ago<rant> For reasons unknown to me, intro-level books for programming languages stopped including exercises. K&R had exercises, SICP had exercises, Dragon Book had exercises. Clojure in Action, Clojure programming, Joy of Clojure, Programming Erlang — none of those have any. What happened? Are they trying to conserve space? </rant>
- __mharrison__ 14y agoI'm currently in the process of going through my (Python) books and making a bundle that includes assignments. These assignments are self-checking unittests. (I guess they would be akin to fill in the blank). Maybe I need to include free form assignments as well (essays). Personally, I do most of my reading on an e-reader, in bed, before going to sleep. I think the approach suggested here would require my re-readings to take place closer to a computer.
- mej10 14y agoI don't see this as a rant. I think this is a genuine problem/complaint with recent programming books. I am not sure what started the trend or why it continues. Exercises are where the learning happens for me. Perhaps well crafted exercises are more difficult to write than programming language documentation/cookbook style books? (which is what most of these books are) There is less focus on books as a teaching method, and rather just a collection of manicured examples and well ordered documentation. (which are also valuable, but not a great way for me (and others, I suspect) to truly learn a language or technology)
- elrzn 14y agoI couldn't care less about programming exercises, but I'd love to have some mini project ideas or examples at the end of every chapter so you can put in practice what you've just learn. I've found that I learn stuff better when I try to adapt code examples to some domain of my own, but sometimes you just lack the drive or are tired of working on the same set of personal "hello world" projects. In this regard Practical Common Lisp is a killer book. Definitely one of my favorites. It's really a pity that there aren't many other books mimicking its style (recommendations are welcome).
- BobWarfield 14y agoAt this late stage in the game, learning a new language for me is a matter of deciding on a project and building it while keeping some appropriate reference at hand. If I read a book linearly at all it's to read just enough to get the "Hello, World" going. BTW, it doesn't take very long to become usefully productive in a language. When I hire developers who've never worked with a language before I budget 6 weeks for them to start being productive and 6 months until they're truly proficient. Because of that, I place a higher premium on their raw talent and level of interest in the platform and type of work we have than on the particular stack they're already familiar with.
- jaxytee 14y agoMy programming II professor would always tell us to step away from the keyboard/monitor, and physically write out a source file x times to help learn a language. There is definitely something to this process that helps language syntax piece itself together in the brain. Probably because it's similar to the process we use to practice writing and reading our human languages.
- marcoamorales 14y agoFor anyone reading to acquire knowledge, or to learn new things, may I recommend How To Read A Book by Charles Van Doren, Mortimer Adler.
- nekopa 14y agoI am applying this methodology to Knuth's TAOCP. So far so good, as I am actually getting through the book this time, because I am just doing the initial read through. TAOCP always used to stump me when I've tried to go through it before because I normally try to understand everything I read before continuing a book. This way at least I am building up an understanding of what I need to learn to be able to understand the book.
- gshubert17 14y agoOne of the key features of Adler's methods, which he emphasizes in _A Guidebook to Learning_, is to "read and discuss". Those who have access to discussion with other learners or mentors, whether in a work or school environment, I think have a great advantage compared to those learning alone.
- martinced 14y agoSo I actually need to read that book twice ? I'm only half-joking here... It's a semi-serious question!
- gshubert17 14y agoIn developing the skills of reading, initially one may need to read stuff twice. With skill and practice, one reading may accomplish several kinds of goals at once.
- nerdfiles 14y agoBeen reading in http://antijingoist.github.com/AlphaSymbolic/ http://antijingoist.github.com/AlphaSymbolic/. I'm not exactly sure what the best strategy is for applying AS to programming languages since it has no "uppercase" glyphs.
- ianstallings 14y agoI think I'm too ADD for this. Here's how I read programming books: 1. Open Table of Contents and find topic I'm interested in. 2. Open page of topic. Read about it. Start coding along. 3. Close book. I feel like I can't really read them any other way. I haven't read one cover to cover in years, and that was when I was doing tech editing for publishers and I had to read the whole thing. Am I alone? Do most of you read the whole thing like a novel?
- DigitalJack 14y agoI pretty much do what you do, although it often leads to a rabbit trail of backtracking to pick up prerequisite concepts.
- pivo 14y agoI do the same, and it drives me crazy. This is one habit I've been trying really hard to break in the last few years.
- Dylanlacey 14y agoInterestingly, if you try to force yourself to read the book from cover to cover, and you find it painful and dreary and you have to FORCE yourself to read every single page, that's a pretty good simulation of what ADHD feels like when doing an uninteresting task. So, perhaps you could try checking out some of the advice for ADHD peeps and seeing if some of the non-illegal strategies work for you.
- martinced 14y agoI do both. At first I open the ToC and go read the few stuff I do absolutely want to read about and "can't wait" to read. Then I force myself to read the entire book like a novel at least once. One of the great thing about reading it at least once is that once a while you'll read something you don't really think you'd need right away or that won't necessarily "click through" but, later on, you'll remember "seeing it somewhere in the book". And bam, you take the book's ToC or index and find back what you're after. I've done it countless time with "Java Concurrency in Practice" for example. At first I read what I wanted to read the most. Then I read like a novel. Then now I use it as a "reference". (most of the book, just like most Java books, can be dumped to trash now that I'm working with a language using lockless concurrency but that is another topic ; )
- alpb 14y agoThat's very interesting. I usually read once, sometimes don't even write code but I fully understand and ready to use the language. Maybe it's about the programming expertise level you already have. Of course, when reading stuff like Haskell, Scala you need to practice but when reading Python, Java... not for me.
- alanctgardner2 14y agoI'm more or less the opposite of the author: I find a problem first, pick the language that seems most suitable or I think I can code fastest in, and have at it. Advantages: - Write interesting code right away, which helps me focus - No need for a monolithic resource like a book, just Google the specific problem to be solved - Solve a problem while learning The biggest downside is that I don't tend to write idiomatic code: when you hack away at your own projects, they all look like your style, regardless of the source language. It took me several months to pick up good C practices at my new job, and I'm still not proficient at Ruby, Python or Java, despite having written plenty of code. To try and combat this problem, I've started reading more advanced documents and talks in languages where I think I've got an OK base understanding. These tend to be more interesting, and better demonstrate the strengths of a given language.
- lallysingh 14y agoI'm closer to your way. First, pick up a shit-ton of books. Or o'reilly safari. Use it to quickly scan for good tools, in combination with GitHub. Then, index the book. That is, read the most relevant chapters lightly, but read the source code closely. Make sure all the source makes sense. If it does, you're in great shape. If not, either the author is poor or you've gotta page-in back references. Then, start hacking together code. Page-fault on the book (and others like it, including example source).
- msprague 14y agoThis is usually how I learn also. I find it works extremely effectively if instead of working on your own standalone project, you contribute to another project that already has best practices. That way, you can read through the source code and learn some of the conventions that are used in that language.
- marcosdumay 14y agoIf you never learned it, how do you know if a language is good for solving a problem? I often choose a random language for solving a small problem, so that I can learn it. It's often not the best language for the problem, but it shows what the language is good for. For me a monolithic resource is great for getting started in a language, but most books are too deep, so I normaly don't finish them.
- scscsc 14y agoNice that the author has read so many programming books so that creating an algorithm for reading such books is cost-effective.
- zxcdw 14y agoOne thing I've learned: do the excercises. Just do them.
- eliasmacpherson 14y agoThis approach really depends on the brevity of the programming books you are reading. I can't see someone leafing through CLRS, then again, then once more shortly afterwards. Or other algorithm books like Algorithms in C, or e.g. SICP or How To Design Programs. I read programming books at a glacial pace, and sometimes I find it very tough going. So tough that I would not be in a hurry to repeat the process, so I take notes. Also I find the desire to read another different book much greater than the desire to retread the same material.
- sonabinu 14y agoThe strategy that works for me is: - read the book and write down the key points (usually a full book will be reduced to around 10 pages) - read the notes, and try to do the examples - rework the examples a second time, refer book and notes
- hayksaakian 14y agoI strongly agree with the author. The first read is like a novel. You want to know the plot, the main events, and not much else. The second read is as though you're going to write a report. Paying specific attention to detail, noting unique and important bits. The last read through is the nitty gritty. You have notes and the flow in perspective. Now you're putting it to real use.