Monday, 8 September 2008

Beginning Programming By Greg Perry - Part1

Today i started reading Beginning Programming Book By Greg Perry.

I wanted to share few important quotations i found from the first 4 chapters from the book.

1) At its simplest level, a computer processes data.Raw data consists of facts and figures, such as hundreds of days of stock prices. A program might process that data into meaningful information, such as a line chart that shows the overall trend of the stock prices over time. It is the computer program that tells the computer what to do. Sometimes, a program might simply process data from another program without showing any output for the user. The processed data is still information because the program’s output, stored on the disk, is changed in some way. For example,a program that closes monthly account balances may collect data from various accounting systems in a company and combine and balance and close that data, resetting the data
for the following month.

2) A compiler converts human-readable source code, formed from a programming language you want to use, into machine language that your computer understands and can respond to. Given that a program is a set of instructions that tells the computer what to do, it’s vital that you eventually get your program into the language of the machine. The compiler does just that.

3) Programs Are Saved Instructions

The computer’s internal memory is vital for holding program execution. Your computer’s CPU cannot execute a program’s instructions directly from the disk. Just as you cannot know what is in a book lying on a table until you read the book’s contents into your memory (using your own CPU—your mind), your CPU cannot process a program’s instructions until it loads the program from disk into main memory.

CPU has direct access to memory but has no access to the disk drive. The disk is the long-term storage, and the memory is the short-term storage, where programs temporarily reside while the CPU executes them.

4) Perhaps a specific example will further clarify what it means to a programmer for a user to use a program. If you use a word processor, then you probably follow steps similar to these:

a. You load the word processing program from the disk into the computer’s main memory. When you select the word processing program’s name from the menu or select the word processor’s Windows icon, you are instructing the computer to search the disk drive for the program and load it into main memory.

b. What you see onscreen is output from the program. You can produce more output by typing text on the screen. Everything that appears onscreen throughout the program’s execution is program output.

c. After you type text, you may interact with other devices. You will probably issue a command to print the document (more than likely using the standard Windows File, Print menu option) to the printer and save the document in a data file on the disk.

d. When you exit the word processor, your operating system regains control. The word processing program is no longer in memory, but it is still safely tucked away on disk.

5) When a program is in memory, it is not there alone. Your operating system always resides in memory. If it did not, you could neither load a program from disk nor run it because the operating system itself is what actually loads programs to and from memory when you issue the correct command. Limited memory often poses a problem for larger programs. Recall that a program processes data and the data and the program must be in
memory before the program can easily process the data.

6) Actually, data is stored inside memory locations. Variables keep you from having to remember which memory locations hold your data. Instead of remembering a specific storage location (called an address), you only have to remember the name of the variables you create.

About the Author

Greg Perry has personally taught thousands of people how to program in the classroom and lectures, as well as impacted the computer world through the sale of more than two million computer books sold internationally.

He has been a programmer and trainer for the past 20 years. He received an undergraduate degree in computer science, followed by a master's degree in corporate finance. After working as a supervisor of financial systems for a Fortune 500 company, he turned to teaching at the college level, where he remained until he began to write full-time and lecture at programming conferences.

Some of his other book titles include Sams Teach Yourself Visual Basic 6 in 21 Days, C by Example, and several books in the 24 Hours series, including Sams Teach Yourself PCs in 24 Hours, Sams Teach Yourself Office in 24 Hours, and Sams Teach Yourself Windows Millennium in 24 Hours. He has also written articles for several magazines, including PC World and Data Training. He is fluent in several computer languages and speaks a little Italian as well.

No comments: