goal of this text book
The goal of this book is to provide a free downloadable text that can be used in college and high school computer programming classes.
According to the Los Angeles Times college text books average $120 each (late 2006) and the major book publishers are still jacking up the prices. According to the LA Times, many poor students are barred from higher education (even though they have financial aid or a scholarship) because they simply can’t afford the price of text books, which can be more than a thousand dollars a semester/quarter.
For-profit book publishing corporations use numerous malicious tricks to keep pushing up the price of text books and reduce the use of recycled used text books. Their racist purpose in engaging in these activities is to price text books out of the range of poor people so as to keep the mostly minority poor children from having the same equal access to education as rich white children. The major book publishers put out new (more expensive) editions of text books every three years. It just happens to be that three years is the amount of time for a text book to saturate the used text book market and cut into sales of new books. The book publishers claim that this is mere coincidence with the timing of their new editions and that they only publish new editions when they need to make improvements on the existing text. They claim it is mere coincidence that these “necessary” improvements happen to exactly match the sales cycle for every text book they publish!
I do actively encourage students, teachers, and professional programmers to provide useful feedback and criticism to help make this project useful as a free downloadable college text book. Donations of money to help support the writing and hosting of this project are greatly appreciated. See mailing address above.
using this text book
This book is divided into two major sections.
This organization reflects the way computer programming is normally taught: an overview class that gives a foundation in basic concepts, followed by a series of more advanced classes that go back over the same material in much more detail.
The first section provides an introduction and overview to computer programming.
This first section is further divided into general discussions and language specific discussions. It is generally unwise for beginners to attempt to learn more than one programming language at a time. Each programming language is color coded. The choice of colors is completely arbitrary and has nno meaning.
The second section provides a detailed examination and reference for advanced studies in computer programming and computer science.
Do not expect for this book to be assigned in the same order as it is written. There are many different ways to teach computer programming, so your particular professor or instructor is likely to change the order of presentation of the material, probably also deleting entire chapters and possibly inntroducing additional outside materials.
In particular, there is more material in the introductory section than can reasonably be covered in a single class. Your professor will decide which materials should be emphasized and which materials should be skipped. Some programming languages naturally emphasize some materials and don’t include others.
Most schools start students on programming as quickly as possible. Don’t be surprised if your professor skips over some or all of the early chapters and tells you that some or all is material that you should already know.
Once the introductory material has been covered, the advanced material can literally be taught in almost any order.
Important Note: For the sake of clarity, much of the material in the first section is watered down and simplified. Most exceptions (including some important ones) will be overlooked. Many details (including some important ones) will be ignored. Terminology will be used in a casual manner without formal definitions. Including all that information would just bog down the discussion and make it more difficult to understand the basic principles.
Table of contents
Section 1: Introduction
- copyright information — page 1
- goal of this textbook — page 3
- using this text book — page 3
- table of contents — page 5
- picking a class — page 7
- syllabus — page 7
- computer programming — page 13
- size of programs — page 13
- basics of computer hardware — page 15
- parts of a computer — page 15 processor — page 16
- main storage — page 17 external storage — page 18 input/output — page 18
- input — page 18
- output — page 19
- kinds of programming — page
- 20 programming languages — page 21
- direct programming — page 21
- machine and object code — page 21
- assemblers — page 21
- high level languages — page 21
- interpreters — page 22
- compilers — page 22
- linkers — page 22
- loaders — page 22
- editors — page 23
- command line interface — page 23
- development environment — page 23
- standards and variants — page 24
- history of programming languages — page 25
- Hello World — page 38
- C — page 39 Pascal — page 41
- PHP — page 42
- creating a program — page 44
- listings and errors — page 45
- free form vs. columns — page 47
- whitespace — page 49
- comments — page 50
- building blocks — page 56
Section 2: Advanced
- Boolean algebra and logic — page 59
- introduction — page 59
- postulates — page 64 assembly languages — page 66
- data representation — page 71
- register set — page 76
- memory — page 82
- addresses — page 88
- data movement — page 95
- character codes — page 124