TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How do you read programming books?

186 pointsby pvsukale3over 7 years ago
How do you read a programming book? By programming books, I mean books which teach a language&#x2F;framework&#x2F;tool.<p>Do you read it in one go and later try examples or go through entire book by trying all examples?<p>Do you read the entire book or just the part to get the job done?<p>What methods&#x2F;techniques have you found useful while reading such books?

35 comments

oceanghostover 7 years ago
I&#x27;m going to give away the secret of autodidactic learning here. I developed this technique in college. Although there was no such thing as YouTube back then, iTunes etc.<p>I get at least two, preferably three data sources on the same subject. Read them all in Parallel and take notes. Getting multiple perspectives is critical.<p>What works for me is two well-made textbooks and a Youtube series, iTunes university, etc course.<p>““In almost all textbooks, even the best, this principle is presented so that it is impossible to understand.” (K. Jacobi, Lectures on Dynamics, 1842-1843). I have not chosen to break with tradition.”<p>–V. I. Arnold, Mathematical Methods of Classical Mechanics [5], footnote, p. 246
评论 #15736188 未加载
评论 #15735780 未加载
评论 #15735785 未加载
评论 #15736948 未加载
jasodeover 7 years ago
1) Make sure you&#x27;re reading a quality book. Sturgeon&#x27;s Law[1] is true -- 90% of everything is crap including programming books. Check amazon reviews, forum recommendations for consensus of quality books. (E.g. many of OReilly &quot;Head First&quot; series of books have cute cartoons but they actually don&#x27;t have quality content.)<p>2) Most programming authors do not write about <i>tradeoffs</i>. They write about language syntax or library features and end up being (inadvertent) evangelists. All languages have warts and problems that books don&#x27;t talk about. To supplement book reading with a dose of real-world realities, always corroborate with forum discussions, stackoverflow, etc.<p>3) Instead of reading 1 book, go through 2 in parallel from different authors. E.g. read about monads chapter in 1 book and find the same topic in another book. Different authors explain concepts in different ways which can help reinforce the learning<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sturgeon%27s_law" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Sturgeon%27s_law</a>
评论 #15734616 未加载
评论 #15734180 未加载
jonstewartover 7 years ago
There are two kinds of programming books. Some are technical references covering a specific technology (usually a tool, library, or framework); I generally find these to have a short shelf-life and to be lower in quality. New versions of software can quickly result in their obsolescence, and sometimes the examples and precise details are not accurate even when published. However, I have found such books to be _essential_ when learning an emerging technology, where maybe there&#x27;s API documentation but very little (or very poorly written) conceptual&#x2F;overview documentation. Often the book&#x27;s author is elbows-deep in the implementation of the technology and can explain some of the essential concepts. I typically buy these kinds of references only when I know I need to come up to speed on something, often a new fresh open source hell with its own jargon (looking at you, Angular), and then I make a dedicated attempt to power through the book and the examples. You can go broke if you buy this sort of book and don&#x27;t put in the effort for an immediate return; also, you can skip whole chapters that aren&#x27;t applicable to your situation.<p>The second kind of programming book covers a broader topic and&#x2F;or more mature technology. They can vary from an academic orientation to almost a sly anti-intellectual style (e.g., the Camel Book). Here you learn core concepts that will be more-or-less evergreen. These are books you will want to read cover to cover and then return to again and again, for years in the future. These books vary in their tone, some serious, some silly, but they all should be fun to read due to the clarity of their prose and presentation of essential concepts. The ultimate example is TAOCP.
评论 #15734835 未加载
评论 #15734926 未加载
MilnerRouteover 7 years ago
I&#x27;ve heard studying &quot;sinks in&quot; when you&#x27;re recalling what you learned earlier. So I spread out the reading of the book, trying to remember the next day what I&#x27;d read the previous day (before checking in the book to see how well I&#x27;ve remembered it).<p>I&#x27;ve also heard people say that you have to learn by doing. So I try to play around with whatever I&#x27;ve learned from the book. Doing the examples is good, but dreaming up your own fun variations can be even better.<p>Someone once suggested that re-typing the examples is actually really helpful too. Your whole brain is engaged -- fingers moving, keypads being chosen -- and whatever patterns there are in the language start to emerge.<p>I think the most important thing is just &quot;be gentle with yourself.&quot; It&#x27;s possible to push too hard to learn something big and complicated all at once. It wouldn&#x27;t hurt to Google up a few online discussions, just to get a little extra context for what you&#x27;re reading in the book -- and a supportive community.
评论 #15735347 未加载
评论 #15735584 未加载
itamarstover 7 years ago
Build a mental map of where to find things, and then refer back for details as needed:<p>1. Skim the whole book. The goal here is to learn basic concepts, keywords, and the structure of the book.<p>2. Start coding, refer back to the book as I encounter things I don&#x27;t understand.<p>This works better with paper books, because it&#x27;s easier to remember where I saw something (&quot;upper corner of left-hand page next to diagram, towards the end of chapter 10&quot;).
评论 #15751646 未加载
评论 #15734302 未加载
Scarblacover 7 years ago
I learn something first by using it, applying tidbits from blogs, online tutorials, Stack Overflow and just trying to figure out how to get it to do what I want.<p><i>Then</i> I read a book on it, cover to cover.<p>It&#x27;s much easier to get everything to &quot;click&quot; when you&#x27;ve already tried to solve the relevant problems yourself.<p>Then continue working with it, and every now and then read another book cover to cover, for important things.
评论 #15734675 未加载
评论 #15735430 未加载
fpisfunover 7 years ago
Lately I&#x27;ve been just reading and reading and reading without actually trying any coding. Mainly I&#x27;ve been reading about functional programming, languages I haven&#x27;t used before, etc. The way I got into programming was through constantly trying to build things, without much formal education. I think once you have a certain amount of real word experience it&#x27;s important to sometimes take a step back and just try to learn about new things without the distraction or pressure of trying to build something right away. This all depends on a person&#x27;s point in their career and goals though of course.
评论 #15734582 未加载
muzaniover 7 years ago
I treat programming as a language. You understand it by going in hard and not trying to understand. If you learn it by trying to dictionary lookup every word, it&#x27;s really slow.<p>Instead, you try to understand the context of a sentence, and then the words back from there.<p>So what I do is I read the table of contents and intro. Intro usually covers what makes the book different and has instructions on how to use it.<p>You&#x27;ll find a few pillars. Like if you&#x27;re reading an algorithm book you&#x27;ll see Big O notation mentioned a few times. Focus on those pillars. Spend more time on them.<p>Maybe from Big O, it will give binary search as an example. Then skim the chapter on binary search and return to Big O until you master it.<p>You&#x27;ll transverse the more important parts of the book better this way. Many books are not strictly meant to be linear.<p>I also recommend transversing content in this way as fast as possible once, in one go. Set aside about an hour to skim the entire book.<p>You&#x27;ll get the &quot;skeleton&quot; of the book, what holds it together.<p>Then you focus on the pillars of the book. And once you&#x27;re done with that, you can do the rest of the content you skipped.<p>Once you read something, explain it to yourself differently to prove you&#x27;ve mastered the concept. This might involve doing an exercise on it. If you&#x27;re familiar with it, just drawing a figure might be good enough.<p>Also I agree with what the others have said: compare with other books on the topic and make sure it&#x27;s a good one before you read anything.
fshaunover 7 years ago
For learning a new language, if I have enough time, I read through the entire book. This helps me learn the terminology and names for concepts. It&#x27;s much easier to search for more information when you know the right jargon. Reading everything helps to gauge the scope of the language and map it to or from known concepts. This is how I read TC++PL and Ada as a Second Language, which I think worked because their of their breadth.<p>Sometimes there&#x27;s not enough time to do that, like when you&#x27;re thrown into an unfamiliar code base or need to interface with a new API. Then I thoroughly read enough chapters to get the syntax and skim the start of other chapters, plus the index&#x2F;glossary, again minly to learn terms. The required depth depends on what you&#x27;re doing. If there&#x27;s an unfamiliar concept heavily used in the code, of course read those sections more.<p>I usually avoid exercises because I already have a project or goal, so I work up my own examples that advance those needs but still use the idea or technique of the exercises. I highly recommend trying out a new technique with a small test before applying it at large, or assuming its use as part of the software architecture. You don&#x27;t want to discover late in the game that the way you planned to use Java generics or C# Pinvoke won&#x27;t work.<p>Sometimes the goal is to learn a new technique or dive deeper into the language. I&#x27;ve immensely enjoyed books by Meyers, Alexandrescu, and Sutter, that have more self-contained sections. I still find it useful to read the ToC or skim the chapter introductions, but my mindset is usually more &quot;how can I apply this?&quot;, and reading everything straight through doesn&#x27;t give me enough time to focus on specific things.
OliverJonesover 7 years ago
I read a mess of these books. I subscribe to the Safari service put out by Tim O&#x27;Reilly and his krewe.<p>I look at the table of contents carefully.<p>I then read the whole book quickly to get oriented. At that point I make a judgement whether it&#x27;s worth more time and effort.<p>Still here? Then I reread any chapters that relate to performance, because those chapters usually give a clear view of interesting issues in the subject system.<p>Then I do one or two of the problems &#x2F; examples &#x2F; demos. I do my best to avoid downloading and running them; rather I take the time to type them over; it helps me cognitively to understand what I&#x27;m doing.<p>Then I evaluate whether the material I&#x27;m learning will help me solve current problems, or give me ideas about solving future problems, or not.<p>I put the book in my Safari queue if it&#x27;s relevant to either current or future problems. Then I go use what I&#x27;ve learned.<p>I wish I could say I wrote a quick personal review of every book. But I don&#x27;t.<p>This works pretty well for me. Safari is a great way to read tons of books, because, well, &quot;tons of books.&quot; They don&#x27;t take up shelf space or have to be moved, or recycled if they turn out not to be useful.
kerneldeveloperover 7 years ago
I will read the first few chapters to learn the basic knowledge. In the meantime, I will try my best to understand every example and run it. And then I will do something interesting such as writing a more complex program. Practice is my motivation to learn advanced topics. If I only read the book, I will lose interest quickly because this is very boring, especially for some difficult chapters.<p>After I think I have mastered the basic chapters, I will continue reading the subsequent contents. I won&#x27;t try to understand everything in the advanced parts. Instead, I just read some useful content and treat other content as a technical dictionary so I can refer to it in the future.<p>I like learning a language&#x2F;tool as quickly as possible, and then try to use it more skilled.
smilesndover 7 years ago
With a beer in one hand and a shotgun in the other.<p>Typically I read the book a chapter or 2 at a time mattering how much information it covers. Mattering how technical it is I will write down every word I either don&#x27;t know or second guess.<p>I will read over the code examples fully. At the end of the chapter I will try to recall the code example in my head, and see if I can replicate it. Mattering how good or bad that goes I will then move on or write the code out.<p>I keep notes the entire time I am reading. It helps keep me focus on the subject matter. My mind loves to wonder to much, and I have to beat it like a alien from the fourth dimension.<p>Also the notes act as long term reference as well I can review them every night for roughly a month to make sure it all sticks.
TomJohnson70over 7 years ago
I have read ALL the comments below. They are ALL excellent. I have a BS in Engineering, 1976, with only Fortran IV from the card key-punch days. Ugh! Worked on a defense software program and learned JOVIAL and VAX&#x2F;VMS at work and C and some Unix at home. Prior, I had read Wirth&#x27;s Algorithms + Data Structures = Programs. Pascal = JOVIAL = ADA. C seemed to have the real power with access to the underlying computer via &amp; and *. C++ appeared to fix many of C&#x27;s short-comings and added many concepts (RAII). Eventually, C -&gt; C++ -&gt; Java. With GNU Project and Yet Another Compiler Compiler (YACC), languages proliferated. Without a CS degree, and all the new languages, I backed off programming and switched to medicine (MD). Years later and retired, I found that I really like sw. I realized that I had gone to, possibly, the only college in the US that did not have C&#x2F;Unix. You folks that studied C&#x2F;Unix are very fortunate, and I envy you. From 01 July 2013 to 30 June 2014, I read 3060 pages on sw. Soon after, a legacy OS company came out with a major change to their paradigm, so I switched to Linux Mint. I love C, Unix, Linux, Linux Mint, C++. This past summer, I had two (2) weeks to teach my 12yo grandson, my son&#x27;s son, programming. We took an old laptop, installed a new 500gb hd, installed Linux Mint 17.3-64bit, and off we went. In 8 days, he was creating his directory structure, text editing, compiling (gcc name.c -g -o name), and debugging. It was great fun. I bought him a used copy or K&amp;R and K&amp;R2. Next summer I am teaching my other grandson, my daughter&#x27;s son, the same stuff. I read K&amp;R in 1983. In 2013 I reread K&amp;R. I read K&amp;R2 every year (4 times now). There are many ways to study, some more efficiently than others. Just do it. My technique is to read the entire book, highlight text, take notes, work examples, and write programs. My first short-term suggestion for a newbie is to buy and read &quot;The C Programming Language&quot;, 2nd Edition, by Kernighan and Ritchie (K&amp;R2). My second short-term suggestion is to download for free and install a free Linux distribution. I like Linux Mint. My third long-term suggestion is to pursue a degree in computer science (CS), or computer engineering from an accredited college.
评论 #15755011 未加载
评论 #15736014 未加载
评论 #15735569 未加载
评论 #15735854 未加载
Retricover 7 years ago
Just start reading the entire thing front to back. Remember, you gain little from a book sitting on your shelf. The goal is not to do specific exercises, but have an index of ideas I can refer back to. Focus on new ideas &#x2F; benefits and think about how I could have used them in the past. This helps to add mental hooks to keep things interesting and aid recall.<p>That said, I may skim sections that are less relevant to what I want to know. For completely new languages &#x2F; API&#x27;s I am going to need to do some coding, but &#x27;exercises&#x27; seem to be their more so people will use books as textbooks than directly useful on their own.
fao_over 7 years ago
Let&#x27;s be honest: I don&#x27;t.<p>They sit on the shelf gathering dust until I eventually make a project needing some of the knowledge contained within. I then dust it off, scour the index for references to, say, &quot;lock-free multithreaded programming&quot;, and read as many sections as I can about that, and as many supplementary chapters as are needed.<p>A few years back, in my teenage years, I read a programming book about compilers cover to cover, I don&#x27;t remember much about the contents, just one or two lexing techniques and something about directed acryllic graphs.
keithnzover 7 years ago
99% of the time I don&#x27;t anymore. I used to read a lot, now I just pull information from the net, I have feeds of information exposing me to new ideas. Most technical frameworks have a ton of information readily available. The only books I go to are Math and Algorithm books I have on my bookshelf when I know something obscure I want is in them.<p>Learning falls into two categories for me<p><pre><code> - Things you don&#x27;t know you don&#x27;t know - Thing you know you don&#x27;t know </code></pre> I also learn things well when I do active experimentation.<p>First one is the trickiest as you need ways to be exposed to something you don&#x27;t know and being able to recognize its importance amoungst the flood of things you are exposed to. Things like HN are helpful.<p>Second one I keep notes on things I know I don&#x27;t know. These often are things that I kind of have a fuzzy idea of what it does, but haven&#x27;t really spent time on understanding exactly what it is. For instance, webpack is on my list, I use it a lot, I modify configs and get stuff done. I have a fuzzy idea of how works. But I haven&#x27;t spent any time understanding it from the ground up and don&#x27;t know how to set something up from scratch. But at some point webpack will bubble to the top of my things where I have knowledge gaps. So when I work on my chosen knowledge gap, I read a bunch of things, conduct a bunch of experiements, look on stackoverflow and look to answer questions, see how other people have solved existing problems.
评论 #15755632 未加载
jesperlangover 7 years ago
I try to avoid programming books. When reading I prefer being disconnected, laying down in a comfy sofa&#x2F;bed with a hot beverage. Programming books doesn&#x27;t work very well for me because they make me want to try out the things I read about, forcing me to be at the computer. Some of them even assume you are sitting at the computer, ready to run examples..<p>If the goal is to improve as a programmer and books being the medium I choose books that doesn&#x27;t necessarily have an obvious link to programming but benefit my thinking around it. Books on design, architecture, media and education being my favourite. I don&#x27;t follow any particular techniques but have grown into some habits (reading ~50 books a year). I read multiple books at the same time (~3-4), usually very different in style&#x2F;topic, alternating between them. This way I never get bored. The new books I choose for reading has to spark some excitement&#x2F;passion in me, otherwise I&#x27;m never going to finish it. It could be as simple as some concept in a book that triggers curiosity, then I just follow the reference&#x2F;bibliography and further do some quick research (amazon&#x2F;goodreads) to see whether it looks like a promising book.<p>Reading about product design will make you a better software designer.. Reading about media will make you see how your application fits in a bigger picture.. ..and so on.
cdevsover 7 years ago
When I started out it took a couple of books &quot;c,c++,java&quot; to realize most started from scratch and taught you functions and loops over and over and walked you through a simple program but I needed to find my own way to challenge myself. Eventually I just decided I wanted to build things and fought my way through documentation and the internet to get it done learning the challenges and problem solving. These days I look for more books on theory and from people who solved large problems.
munificentover 7 years ago
Generally, cover to cover, going as quickly as I need to in order to avoid losing interest and abandoning it. This is probably not the most effective way to absorb the material. I would learn <i>more</i> by doing the exercises, taking notes, etc. But when I&#x27;ve tried to do that, I usually don&#x27;t get more than a couple of chapters in before I run out of willpower.<p>So these days, I figure absorbing half of the whole book is better than absorbing all of only a small prefix of it.
danielvfover 7 years ago
I think I’ve followed the same method for decades.<p>1. Read the whole book in one sitting, to get the big picture in my head, and build a mental model of the thing.<p>2. Implement a toy project using the thing. Maybe an hour or two. Go back to the book for details as needed.<p>3. Look up something once or twice when building my first real project.<p>4. Never read the book again.<p>In spite of the short time I spend with them, it’s so valuable to be able to read at high speed, on paper, a comprehensive bunch of code and concepts.
extrememacaroniover 7 years ago
With books that teach a <i>language</i> or advanced stuff about a language, like, say, C# in Depth, I read from start to finish, without actually doing any exercises or really anything else.<p>I trust my memory enough to rely on remembering that &quot;C# in Depth was talking about this thing&quot;, when I run into something IRL. Then I go back to the book and see what it had to say.
acgIssuesover 7 years ago
If the book is documentation, I only read as needed.<p>&gt; Do you read it in one go and later try examples or go through entire book by trying all examples?<p>I do a few of the examples until I learn and figure out how the &lt;topic&gt; works. I won&#x27;t be doing all the examples, if they&#x27;re just teaching the syntax or simply showing stuff that can be found at the documentation like functions parameters.<p>&gt; Do you read the entire book or just the part to get the job done?<p>I only read the whole book if I&#x27;m completely naive and want to deeply learn about the &lt;topic&gt;. I usually jumps chapters which have content I&#x27;ve used before and is not difficult to me.<p>&gt; What methods&#x2F;techniques have you found useful while reading such books?<p>Write your own cheatsheet or take notes as you go. Also use the official documentation for functions definitions and similar stuff.
hugjaover 7 years ago
1. Preview &#x2F; Questions - Take a gander at the chapter by reading the introduction, headings, sub-headings, diagrams, images, example code, summary, exercises, questions, etc. Also, write down questions as I preview for myself to answer after step 2.<p>2. Read &#x2F; Recall - After previewing I start reading in full. During code examples I like to soak them in without running them. Then I&#x27;ll close book and try to recall the code by typing.<p>3. Teach &#x2F; Explain - I follow up with pretending to teach &#x2F; explain the code examples and my exercise solutions out loud. This helps me figure out what I didn&#x27;t really understand.<p>4. Project - I try and apply what I&#x27;ve learned from book to a personal project.
Clubberover 7 years ago
I have a bookshelf full of ones from the 90s and early 2000s, but I haven&#x27;t read one in years. I mostly learn from internet articles now.<p>Back then, when I would get a book on a subject I was familiar with, lets say C#, I would skip to the chapters I felt I needed more understanding of or what interested me at the time. (technique #1)<p>If it&#x27;s a brand new technology, I&#x27;ll read the intro chapters that go over the basic stuff (technique #2) to help me get accustomed to the syntax and nuances of the technology, then apply technique #1 (which could be the rest of the book for new stuff).
potta_coffeeover 7 years ago
I&#x27;ve never actually gotten through an entire programming book. I&#x27;m too hands on. I usually get to building stuff before the book is through. This is good and bad. I&#x27;m self-taught and I really want to get through this algorithms book, but I keep getting distracted.<p>Books are great but many times, they spend so much time on information that I don&#x27;t need instead of the practical stuff.
weegoover 7 years ago
Skim the book making notes of key parts with pen and paper. The act of making the notes is usually enough for me to commit enough of it to memory to know what to look for when I need it so I get generally don&#x27;t need the notes again. Then I get going on a simple project that is of relevance to me rather than the one in the book and use the book for reference as necessary.
antoaravinthover 7 years ago
I believe its important to interact or ask your doubts upfront instead of keeping it to yourself. I&#x27;m currently reading Haskell and I use freenode irc channel to ask my queries. The channel community is so helpful in clearing my doubts, in fact they could give much more easy &#x2F; right approach for the problem than the text book solutions.
jimmaswellover 7 years ago
I&#x27;ve almost never used books to learn programming. I read a bit of SICP a few times but lost interest. Otherwise all I do is just follow whatever &quot;x guide&#x2F;tutorial&#x2F;introduction&quot; I find on google, or the language&#x27;s official documentation if it serves as a good learning resource, like for Python and Microsoft properties.
naragover 7 years ago
Long time I haven&#x27;t, but when I did, I usually read three or four first chapters in a row, then jumped to certain chapters that I specifically needed.<p>Also most of the times, the intro and the very first chapters are optional, motivational.
literallycancerover 7 years ago
Choose a good book. Read a chapter or two before breakfast. Run all the code examples in your head (probably not needed, just my OCD -- same thing with being reluctant to trust calculations without redoing them myself).
akashpaulover 7 years ago
By not stopping at chapter 1. Depends on the framework to go all in or chapter by chapter. Also a GitHub repo for each book is an excellent idea.
ncfaustiover 7 years ago
Check out How To Read A Book by Mortimer Adler. Great resource for techniques for understanding many different kinds of books.
chrisgdover 7 years ago
if you spent an hour each day, 40 mins is taking notes on a legal pad, reading, trying stuff, etc. The remaining 20 mins is writing in a notepad the key concepts, summarizing from the other 40
cgagover 7 years ago
sometimes read it all and intend to go back and do exercises, sometimes read it all and actually do them on the way. Probably not all of them.
janciover 7 years ago
I don&#x27;t.