For Dummies Beginning Programming with C++ 978-0-470-61797-7 사용자 설명서

제품 코드
978-0-470-61797-7
다운로드
페이지 12
10
Part I: Let’s Get Started 
For example, I say things to my son like, “Wash the dishes” (for all the good it 
does me). This seems like clear enough instructions, but the vast majority of 
the information contained in that sentence is implied and unspoken.
Let’s assume that my son knows what dishes are and that dirty dishes are nor-
mally in the sink. But what about knives and forks? After all, I only said dishes, 
I didn’t say anything about eating utensils, and don’t even get me started on 
glassware. And did I mean wash them manually, or is it okay to load them up 
into the dishwasher to be washed, rinsed, and dried automatically?
But the fact is, “Wash the dishes” is sufficient instruction for my son. He 
can decompose that sentence and combine it with information that we both 
share, including an extensive working knowledge of dirty dishes, to come up 
with a meaningful understanding of what I want him to do — whether he does 
it or not is a different story. I would guess that he can perform all the mental 
gymnastics necessary to understand that sentence in about the same amount 
of time that it takes me to say it — about 1 to 2 seconds.
A computer can’t make heads or tails out of something as vague as “wash the 
dishes.” You have to tell the computer exactly what to do with each different 
type of dish, how to wash a fork, versus a spoon, versus a cup. When does 
the program stop washing a dish (that is, how does it know when a dish is 
clean)? When does it stop washing (that is, how does it know when it’s 
finished)?
My son has gobs of memory — it isn’t clear exactly how much memory a 
normal human has, but it’s boat loads. Unfortunately, human memory is 
fuzzy. For example, witnesses to crimes are notoriously bad at recalling 
details even a short time after the event. Two witnesses to the same event 
often disagree radically on what transpired.
Computers also have gobs of memory, and that’s very good. Once stored, a 
computer can retrieve a fact as often as you like without change. As expen-
sive as memory was back in the early 1980s, the original IBM PC had only 
16K (that’s 16 thousand bytes). This could be expanded to a whopping 64K. 
Compare this with the 1GB to 3GB of main storage available in most comput-
ers today (1GB is one billion bytes).
As expensive as memory was, however, the IBM PC included extra memory 
chips and decoding hardware to detect a memory failure. If a memory chip 
went bad, this circuitry was sure to find it and report it before the program 
went haywire. This so-called Parity Memory was no longer offered after only 
a few years, and as far as I know, it is unavailable today except in specific 
applications where extreme reliability is required — because the memory 
boards almost never fail.
05_617977-ch01.indd   10
05_617977-ch01.indd   10
7/6/10   11:38 PM
7/6/10   11:38 PM