|That is where the bad coding habits come into play though. If they give you something to code, you code it, but then have nothing to learn how to improve upon (ie find you use a method that is bad) you will never know that you need to fix it. Have to know how the answer should have looked to compare yours and see where you need improvement.|
Sure you do, you can always look back on the chapter you just read and figure out what you are missing or why it isn't working. Also if the author didn't show bad habit I doubt they would seep into your own code (Though I guess it does happen).
And does getting answers really give you a extra reason to improve upon what you already coded or does it just give you the answer and you can move on? I think making the reader actually come up with the solution their self and figure out ways to improve that solution is a much better learning experience instead of jumping to the answer page when something isn't going right.
Also there isn't really one way to solve a problem usually when you are programming. Just because they author solved it one way doesn't mean that it is the only way and you need to strive to solve it that way also.
Basically it all comes down to problem solving. If the author doesn't give you the answers and makes you figure out if you did the program correctly or not or whether it needs to be improved upon (Whether it be by rereading some of the chapter or browsing the internet or whatever) you are learning to solve your own problems and not look to others for what the correct answer is.
Programming is all about problem solving, and once they start developing their own programs there isn't going to be a answer sheet somewhere that they can look up to see if they did their program correctly or how they can improve upon it :).
So to kind of sum it up yes they might have bad habits when they first start out but them can be unlearned when you start to gain more knowledge in programming I believe. What is more important in my opinion is learning to problem solve, even if you are coming up with solutions that use bad habits.