Hacker News new | ask | show | jobs
by fshaun 3129 days 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'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.

Sometimes there's not enough time to do that, like when you'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/glossary, again minly to learn terms. The required depth depends on what you're doing. If there's an unfamiliar concept heavily used in the code, of course read those sections more.

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't want to discover late in the game that the way you planned to use Java generics or C# Pinvoke won't work.

Sometimes the goal is to learn a new technique or dive deeper into the language. I'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 "how can I apply this?", and reading everything straight through doesn't give me enough time to focus on specific things.