5 ms·
<rant> For reasons unknown to me, intro-level books for programming languages stopped including exercises. K&R had exercises, SICP had exercises, Dragon Book h
by 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).
- jordan0day 14y ago> 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?
- tsm 14y agoMany 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!"
- djcb 14y agoIt's the difference between understanding and copy-pasting.
- michaelochurch 14y agoHere'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.
- jwoah12 14y agoYou 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?
- michaelochurch 14y agoNew 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.
- jwoah12 14y ago
- jordan0day 14y ago> 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.
- pivo 14y agoI 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.
- douglasisshiny 14y agoAs 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.
- npsimons 14y agoI'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_todd 14y agoSame 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.
- mononcqc 14y agoI've written Learn You Some Erlang (http://learnyousomeerlang.com http://learnyousomeerlang.com, http://nostarch.com/erlang 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.
- mtgx 14y agoLearning Python the Hard Way is all exercises, because it's based on this concept that you need to do exercises and projects to learn.
- deleted 14y ago[deleted]
- fogus 14y agoSince 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.
- puredanger 14y agoBrian Marick's recent book FP for the OO Programmer (https://leanpub.com/fp-oo 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.
- brooksbp 14y agoYou would consider Dragon book as intro..?
- xentronium 14y agoNo way! It just came to my mind as a book that has practical exercises.
- mbrubeck 14y agoReal World Haskell is a great intro Haskell book published just a few years ago, and it has exercises: http://book.realworldhaskell.org/ http://book.realworldhaskell.org/
- marcosdumay 14y agoFor 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.
- deleted 14y ago[deleted]
- frozenport 14y agoThese hip languages are used more industry and less as teaching aids. It is not unheard of for K&R exercises to be homework problems.