>There's a fine line that needs to be walked.
The complete beginner needs
>to be given a chance to start off with success at something trivial
On Wed, 21 Sep 2011, John Foust wrote:
Windows programmers using Petzold's book
weren't Comp Sci 101 students.
They were existing programmers who wanted to learn Windows. I'd argue
For a while, Petzold seemed to be the ONLY way to learn Windoze
programming.
that showing proper error handling for a Windows
function is just
as important as demonstrating how to call the function.
Absolutely!
The RETURN is half of the function call.
And, I've had students contest their grade when they wrote code that put
out the correct result and CRASHED.
So much of his crap code was copied-and-pasted into
place.
Why does it still feel like apps under Windows XP are running out of stack?
Twenty years later, their failure modes still feel like Windows apps
aren't checking return values on calls that might fail when allocating
special RAM.
Too many people never seem to learn that a program that works is NOT
"correct" unless it would also work with bad inputs or other conditions.
"Your program worked! That's a very good START. Now, what happens if the
user types in 0 for the input value? What happens if the user types in
"NO" instead of a number? What happens if the user puts a space in the
middle of the name that they are supposed to type in?"