How many of you actually work out the exercises when learning from a book (any programming related book), I'm currently working my way through a C++ book and find that some of the exercises I feel I can complete rather easily I skip. Do most people do this? Or do they read the whole book and come back to exercises that looked difficult?
I find it to be helpful to actually type in the solutions to the exercises and run them. Sometimes you'll get the answer on the first try, and sometimes it's a little bit trickier than it first looked. You'll never know what you're missing until you have working code.
One huge benefit to typing in the exercises yourself if that you get practice debugging. If it's a new language and a new environment, you'll inevitably make mistakes. Getting the solutions to even the simplest problems to work is good practice.
Its quite hard to learn a language from a book, computer language or human, without practices you will never master it.
I usually find that doing the excises and typing in the examples gives you much more context, and understanding, even the ones that looks easy, might teach you something about how the compiler works, and other things that one needs to know to actually use the language.
On the other hand I almost never manage to finish a book about a new language, as it takes ages to go through all exercises, but I would at least try to do an excise in each topic.
Another great aid is as "thorsten müller" suggests, to have some project to start to implement, fx. a B-tree sorting or something is always fun to implement :).
If you're reading Knuth, you really aren't getting anything out of it unless you read along with a pencil and paper. Of course, some of the Knuth problems are well known open problems, so you won't expect to get them all.
As an instructor, however, I've found that many exercises in many otherwise good books are just terrible. Some of them are just BS, seemingly tacked on at the last minute. As a result, when assigning problems in class, I have to make my own. So long as you focus on the right books and the right problems, you'll get a lot out of it. I recommend you do the ones in K&R, even if your goal is learning C++.
Only those that look interesting and challenging. If I know the answer, there is not much use in typing it.
Most of the time when I read books about a new language or technology I have my own small projects that I try to implement. Starting with Conway's game of Life, followed by a Sudoku solver. This has the advantage, that I've already solved them in other languages and can compare the results.
Though at the moment I'm learning Racket and since I have some difficulties with some details of the syntax I'm doing far more exercises than usual to get used to it.
I do the most simple ones quickly in my head, if that simple exercises even exist. I also try to see if I have the idea of how to implement one of the exercises, but don't implement them most of the time. The reason to actually implement is to see if you really got things right, as the compiler will be way more pedantic than your mind will be, and it will know the language better as well. But this varies, as the reason for doing the exercises is to repeat the knowledge you have gotten from the latest chapter and to actually make sure you know the stuff.
If exercises don't exist, I make some up on my own. I also always at least try to use the stuff in the chapter (type the code into Vim, execute, change etc.).
I sometimes leave some exercises for later, or to the end of the reading session (if I happen to read multiple chapters).
The exercises are there to aid learning, and I use them when I need that aid.
If I am learning a new language and I know that I am going to work a lot in it I will defietely do each annd every exercise. By doing this I "absorb" the language and my basic syntax becomes strong. Also this way you dont just learn to code but also to "think" in a particular language. The second time I revise it I may not need to do the exersise.
At the same time IMO it isnt the same for all languages. Fore example I did not have to practice SQL too hard to become proficient in itwhereas for C/C++, I have practiced it at least four times (including my college course) to become proficient in it.
Some people have the discipline to actually go through books and do exercises, but I am not one of them and I suspect many are the same way.
I think the model of book-learning is an outdated one. I would try and find lectures/labs online and do those.
For example, I learned the basics of Python by doing the Google Code University course.
In the end, there is no substitute for real-world experience and all that matters is that you actually learn the material, not how you do it. My advice is do it the quickest/easiest way instead of punishing yourself.