Published 1998. Answers used to be online in the publishers site, but they have gone for a long time ago. Please, anyone?
Published 1998. Answers used to be online in the publishers site, but they have gone for a long time ago. Please, anyone?
What is the point of doing exercises ..if you look at answers ?
.\..all you need is some common sense and a compiler.
..that is a valid point...but taking a peek generally turns into taking a peek every few seconds (and have a shallow copy !)And if stuck, take a peek at how they did it, and get insight on how it is possible to do such a thing.
That is not always enough, as you should know. You may think it's right, but in might really not be.
It might just happen to work for a certain case. But for all other cases, it might be wrong.
People can kill other people with guns, but that doesn't stop stores from selling them...that is a valid point...but taking a peek generally turns into taking a peek every few seconds (and have a shallow copy !)
So basically, the example becomes a lesson in debugging. That crucial skill programmers are supposed to have.
I get the "check your work" motivation for looking at provided answers, but I think you end up comparing the author's solution to yours just to see what they did different logically, and so forth... look at the errata to see if there are any mistakes in the answer etc. (Do people even think about the answer being a good answer?) Since depending on a textbook answer is frankly a mark on my pride, I don't encourage it either.
But, you know, it's bad to hide the answers from people with that sort of pretense. If the answers aren't online, they probably aren't anywhere except the wayback machine (if it's up) or in a companion workbook. You could also get a teacher's edition of your text.
There are problems that can be debugged, and there are problems that cannot. Compile errors is one typical example.
Put yourself in a newbie's shoes. They don't know what the compile errors mean. But perhaps by peeking at the solution, they might find out where their code differs from the answer, and by means of that, be able to detect and fix such mistakes in the future.
Also, if you get stuck, have no idea how to proceed after thinking and designing, taking a peek at a solution is usually more enlightening than just banging your head against the wall!
You can learn a lot by looking at answers and solutions.
Just looking at solutions and not doing the exercises sure enough won't help you in the end, but there are a lot of legitimate reasons to look at the answers and solutions. Don't underestimate those!