Thursday, 11 September 2008

Beginning Programming By Greg Perry - Part2

Couple of Days back i started reading Beginning Programming Book By Greg Perry.

I wanted to share few important quotations i found from the next 4 chapters(5-6-7-8) from the book.

1) ASCII stands for American Standard Code for Information Interchange.

2) Every Character Possible Has Its Own Unique ASCII Value
















CharacterASCII CodeDecimal Equivalent
Space0010000032
00011000048
10011000149
20011001050
30011001151
90011100157
?0011111163
A0100000165
B0100001066
C0100001167
a0110000197
b0110001098


3) Unicode spans far more than the 256 character limit of the ASCII or EBCIDIC tables in order to take into account languages such as the Japanese-based kanji and others that require numerous characters to represent. Unicode assigns hundreds of numbers to hundreds and even thousands of possible characters depending on the language being represented.

4) When you print a document from your word processor, the computer prints each “character” stored in that memory location, the computer’s CPU sends the ASCII code for the letter A to the printer. Just before printing, the printer knows that it must make its output readable to people, so it looks up 01000001 in its own ASCII table and prints the A to paper. From the time the A left the keyboard until right before it printed, it was not an A at all, but just a combination of eight 1s and 0s that represents an A.

5) Generally, For loops are useful when you must count values or iterate the loop’s body for a specified number of times. The While loop is useful for iterating until or while a certain condition is met. If you are counting up or down, a For loop is easier to write and is slightly more efficient than an equivalent While loop.

6) Both the If statements and the For statements, as well as the Do statements, rely on conditional values to determine their job. Nevertheless, an If statement is never considered to be a loop. Always keep in mind that an If statement executes its body of code at mostly one time, and possibly never if the If is false to begin with. Even if the If condition is true, the If statement never executes its body more than one
time, unlike the looping statements that can repeat their code bodies many times.

7) Structured Programming

Structured programming is a philosophy stating that programs should be written in an orderly fashion without a lot of jumping to and fro. If a program is easy to read, the program is easier to change. People have known for many years that clear writing style is important, but it became obvious to computer people only after nearly 20 years of using nonstructured techniques.

8) Structured programming includes the following three constructs:

• Sequence
• Decision (also called selection)
• Looping (also called repetition or iteration)

9) Profiling Code

A profiler is a program that monitors the execution of your program, looking for sluggish code that might be optimized for speed or size. Many of today’s compilers are optimizing compilers that try to take your code and turn it into the fastest possible machine code, but there is always room for improvement. On average, 5% of a program takes 95% of the program’s execution time. The profiler can help you improve the speed and
efficiency of your program.

Advanced programming systems such as Visual C++ come with profiling tools that help you locate sluggish areas of your program. You cannot always speed up a program, but if parts of a program are slowing down the overall operation, you might be able to optimize the code to keep the program flowing smoothly. A profiler can also help you pinpoint when files get so large that faster disk drives and more memory might be beneficial to the operation of a program.

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: