News for hackers. Stuff that matters.
Re:How I Read Programming Books by xentronium on Tuesday January 08, 2013 @10:34AM (#5026640)
<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>

Re:How I Read Programming Books by fogus on Tuesday January 08, 2013 @01:29PM (#5027564)
Since you mention Joy of Clojure, it's worth a response.

First, I would love to include exercises, however two factors conspire(d) against us. First, some of our favorite C.S./programming books have amazing exercises, so we respect the art of creating interesting and relevant supplementary material. It is no small task to design a book that flows, teaches the right lessons and also provides a set of exercises.[1] If we were to include exercises we would think very hard about what to include and how it fits into the book as a whole.

Second, the schedule for our book was quite tight given that we both have families and full-time jobs. We could write the book in a satisfactory way on time, or we could include exercises. We chose to write the best book possible given our time and ability (or lack thereof). We actually did create some exercises, but felt it was not worth including a partial set. Maybe next time. However, all of the same considerations would apply.

As you'll notice, our exclusion had nothing to do with page count.

Great question.

[1]: I should say, "for us" since others seem to do it easily.

Re:How I Read Programming Books by mej10 on Tuesday January 08, 2013 @10:50AM (#5026732)
I 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)

Re:How I Read Programming Books by jordan0day on Tuesday January 08, 2013 @11:19AM (#5026890)
> Are they trying to conserve space?

While I haven't read the four you mention not having examples, in my experience, "conserving space" is the last thing most programming books do.

Reading this post, my first thought was "How do you read a programming book 3 times? They're so long?"

I actually feel like most programming-related books are artificially padded with unneeded content, just for the sake of making them longer. Perhaps so they'll seem more like they're worth their price?

In my opinion, too-long technical books are a problem. If you've only got an hour or two a day to read, it can take a week or two to get through a decent-sized technical book. Add in xentronium's point about lack of exercises, and I don't know how anyone is supposed to retain much knowledge from these books.

Re:How I Read Programming Books by pivo on Tuesday January 08, 2013 @12:57PM (#5027361)
I understand that at least one publisher prefers thick books because that makes the spine wider and therefore the book is more visible on the shelf in the bookstore.

Maybe now that so many books are purchased online this isn't as much of a concern.

Re:How I Read Programming Books by elrzn on Tuesday January 08, 2013 @11:01AM (#5026796)
I 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).

Re:How I Read Programming Books by jordan0day on Tuesday January 08, 2013 @11:21AM (#5026896)
> I 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.

"mini project ideas or examples at the end of every chapter" sound like exercises to me?

Re:How I Read Programming Books by tsm on Tuesday January 08, 2013 @11:39AM (#5026969)
Many SICP exercises would be similar to, "Ben Bitdiddle thinks he can define COND like this: [bunch of code]. Show why he's wrong." Which is not practical whatsoever--it's clearly a short problem for academic purposes.

In contrast, PCL would say, "Now we can write a media server, let's go!"

Re:How I Read Programming Books by djcb on Tuesday January 08, 2013 @04:46PM (#5028707)
It's the difference between understanding and copy-pasting.
Re:How I Read Programming Books by douglasisshiny on Tuesday January 08, 2013 @11:23AM (#5026912)
As someone who has semi-recently started getting back into programming, this is a big deal for me. Starting with Ruby (reading The Well Grounded Rubyist) -- I read the book, felt like I understood a lot of it well except some of the more advanced stuff, but was stumped when considering my own practice problems and how to solve them.

Providing small, challenging problems is a very valuable resource. I'm currently reading An Introduction to Programming in Java (as preparation for the Princeton Algorithms course on Coursera). While the book may not be the best Java book, each section has 40+ programming exercises. Sometimes the exercises are boring, but I do most of them anyway because they are in themselves a learning exercise.

Re:How I Read Programming Books by mtgx on Tuesday January 08, 2013 @12:58PM (#5027367)
Learning Python the Hard Way is all exercises, because it's based on this concept that you need to do exercises and projects to learn.
Re:How I Read Programming Books by puredanger on Tuesday January 08, 2013 @01:39PM (#5027628)
Brian Marick's recent book FP for the OO Programmer (https://leanpub.com/fp-oo) has a phenomenal set of integrated exercises. I think they're valuable even for an experienced developer in thinking through problems in new ways.

I think writing great exercises that teach and integrate with the text is really hard and many authors/publishers don't have the time or incentive to do so.

Re:How I Read Programming Books by mbrubeck on Tuesday January 08, 2013 @06:20PM (#5029141)
Real World Haskell is a great intro Haskell book published just a few years ago, and it has exercises: http://book.realworldhaskell.org/
Re:How I Read Programming Books by mononcqc on Tuesday January 08, 2013 @12:20PM (#5027165)
I've written Learn You Some Erlang (http://learnyousomeerlang.com, http://nostarch.com/erlang) and this is of interest to me as a choice to make as an author.

First of all, there are a few main categories of exercises I encounter when I read:

1. exercises left to the reader 2. exercises with solutions

When I read a book, I typically dislike exercises left to the reader, especially because when I get to work on a solution, I have no idea whether it's any good at all, especially in a language-specific book where there's a good chance my solution is bad for not being familiar with the language -- not necessarily a lack of reasoning as much as familiarity.

SICP is one exception to this in my experience (I haven't read all the books in your list), because it's not language specific, and I'm reading it with the known mindset it will take months to go through. I'm not reading it to learn Scheme, but to learn to program, and in my opinion, there's a different mindset involved. Still, there were times where I wished I could get solutions without buying a separate manual. I ended up looking for solutions online and found many of them; this isn't an option with many new books, and shouldn't be expected as a feature.

For exercises with solutions, I like these a lot better to begin with. I can work on things until I fail, absorb the solution by reading it, and gaining experience. If you have plenty of exercises, the solutions will significantly increase the volume of the book, though. An online repository is a very decent solution, and even lets you add comments and explanations.

I want to focus on the idea of explanations. Exercises with flat solutions without any explanation of what is going on, just "it works" are something that somewhat annoys me. "Here's code, figure it out kiddo" is a valid approach and makes sure the reader that goes through it still understands a lot, but it doesn't mean the reader won't miss stuff.

If I take the typical quicksort example of functional languages and just say "Implement quicksort using language X" and show one solution, it's up to the reader to figure out whether it's optimal, demonstrative, etc. ("Why is it important to pick a pivot the way it was done?") If there are indications, then it's nice to know how the code works, but you don't always get to understand how to create such code on your own. You will tend to know why the code is the way it is, but not necessarily how to build similar though different code on your own -- there's a subtle distinction there.

This is where a lot of exercises fall short, in my opinion. It's more obvious in math books where only the final answer is given. You can validate your answer, but if you don't know how to come up with one, you're lost. Good luck, ask someone or go back until you're brilliant enough to do this exercise. If there are steps done, nothing tells the reader why that one was picked or why the author decided to attack from that angle instead of any other one. Personally, this would tend to get me into the area where I know how to solve the exercises in the book, but I'm quite unsure about how to solve those outside of it.

I do prefer the approach where the exercises are something you can be guided through. The author explains the design decisions and why things are the way they are. I found it's a format that made more sense to me when I was watching screencasts, or when working with a trainer (or as a trainer), teacher, or whatever. It's how I was taught sports, music, and so on. It might just be a result of how I personally learn better (a series of explanations why things are done the way they are, not just letting me speculate why), and different people tend to learn differently.

The downside of this approach is that it's significantly longer, and you'll have far fewer exercises available as a reader (time and space are limited resources).

That's the approach I tried to take with LYSE. I'm not saying I got it right, or that it's better than whatever other approaches that exist, but it's the one that made the most sense to me as an author, because it made sense to me as a learner. I like that I can be guided through examples, that the person teaching me tells me "here are the possible ways to do it. I picked this one because of reasons x, y, and z", as I feel I now know how to make similar decision on my own in the future when encountering similar problems.

Re:How I Read Programming Books by kevinnk on Tuesday January 08, 2013 @03:19PM (#5028221)
One of the approaches my statistics books take is to include the numerical answers in the back of the book but have a separate guide for sale if you want to know why specific approaches were taken. By being an extra book, students who need the extra help pay extra for the time to compile all the extra solutions. This also keeps the cost low for people who only need a reference.
Re:How I Read Programming Books by alanctgardner2 on Wednesday January 09, 2013 @08:10AM (#5031292)
When you say 'my', I can't tell if you mean books you've written, or books you've read. Either way, writing the solutions is non-recurring work; the cost to print the extra pages should be pretty marginal compared to the presumably > $100 cost of the textbook. To my mind it looks more like 'we get two bites at the apple', rather than saving the poor students the extra $10 to get the solutions with their textbook. Of course, I don't know how much the solutions manual costs, but I feel like this approach compromises the student's experience, when they should really just get all the content up-front.
Re:How I Read Programming Books by npsimons on Tuesday January 08, 2013 @11:52AM (#5027031)
I'll second this; the books I've retained the most from are the ones I've done the exercises for. Hell, even PragProg had exercises! Effective C++? Nada. I'm lucky if I can remember enough from it to remember to look things up.
Re:How I Read Programming Books by re_todd on Tuesday January 08, 2013 @09:11PM (#5029726)
Same here. I'll often buy a substandard book from the "21 days" or "24 Hours" series, even with all their lack of editing and inferior writing, over other books. Why? Because the exercises they usually have help me retain more that a better book.
Re:How I Read Programming Books by __mharrison__ on Tuesday January 08, 2013 @11:06AM (#5026817)
I'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.

Re:How I Read Programming Books by marcosdumay on Tuesday January 08, 2013 @09:25PM (#5029771)
For some reason, I never could do the exercises of programming books. When I started them, in the end I had a completely different program that solved something that affects me.

I also could never read a programming book from the start to the end. When I used the language a lot and used the book as reference, I read all the pages somewhen in a several months interval, and in some random order. When I didn't use the language a lot, I just didn't finish the book.

Nowadays the best reference is online, so while books are still good for giving me a start, there is a long time that I don't finish one.

Re:How I Read Programming Books by frozenport on Wednesday January 09, 2013 @03:36AM (#5030728)
These hip languages are used more industry and less as teaching aids. It is not unheard of for K&R exercises to be homework problems.
Re:How I Read Programming Books by brooksbp on Tuesday January 08, 2013 @03:14PM (#5028200)
You would consider Dragon book as intro..?
Re:How I Read Programming Books by xentronium on Wednesday January 09, 2013 @05:49AM (#5030978)
No way! It just came to my mind as a book that has practical exercises.
Re:How I Read Programming Books by michaelochurch on Tuesday January 08, 2013 @11:11AM (#5026844)
Here's the problem I see with exercises for professional, working developers.

Are exercises useful? Yes. But doing a significant fraction of them increases your read time substantially. It pays off, but now there are other ways (at work, or in open source) to learn things that are less structured but still effective.

Exercises help you get a deep knowledge of the material, but the market doesn't reward that. You're better off with a more shallow knowledge of a lot of things.

The old cycle for learning X:

1. Get an X book. Do a basic reading to get the vocabulary and core concepts.

2. Decide if you're interested in deep knowledge of X. If yes, continue. Otherwise, terminate and choose a new X.

3. Do the exercises in the X book. This will take a while.

4. Do some X at your job.

5. Read the research papers if you want to get to the frontier.

New process:

1. Get an X book. Do a basic reading to get the vocabulary and core concepts. (Same as above.)

2. Decide if you're interested in deep knowledge of X. If yes, continue. Otherwise, terminate and choose a new X. (Same as above.)

3. Get a job doing X. The knowledge and vocabulary learned in (1) should be enough to pass an interview.

4. Refer back to the book and, when needed, read for deep detail to supplement your on-the-job learning.

5. Read the research papers if you want to get to the frontier. (Same as above.)

Step (4) of the new cycle is where the exercises would come in, but most people by that point are just trying to solve the problem at work.

Re:How I Read Programming Books by jwoah12 on Tuesday January 08, 2013 @11:21AM (#5026898)
You act as if "Get a job doing X" is a trivial step in the learning process. What if someone doesn't want to get a new job in order to practice X?
Re:How I Read Programming Books by michaelochurch on Tuesday January 08, 2013 @11:27AM (#5026926)
New job != new company. One could transfer internally, or find a project involving X and contribute, or in the right environment, come up with a new project entirely.

If you don't have the autonomy to learn new X's as you wish, then your job probably doesn't justify aversion to looking elsewhere... unless it's paying you hedge-fund money.

Re:How I Read Programming Books by jwoah12 on Tuesday January 08, 2013 @11:41AM (#5026978)
Well you kind of implied new company when you mentioned passing the interview (yes, I know at the larger tech firms you can interview for other teams internally). Either way, I don't think changing jobs internally, starting a new project, etc. are trivial tasks either. If I'm content working on my current Java project at work, but I'm interested in learning some Python on the side, I don't think I should have to switch jobs/roles/companies/projects just to practice Python. Also, while I agree with you that it would be nice if most companies offered the autonomy to work in whatever technology you wished, that simply isn't the case, and not everyone has the freedom/motivation to change jobs easily.