The World of Programming - Pascal programming

What is Programming?

The subject of this book is programming, and as you progress, you will discover that programming is the art of instructing the computer to perform specific actions. In other words, to get the CPU and its components to work together and achieve a goal, such as, for example, solving a problem. This is done by providing the computer with a set of instructions written in a program language. Why do the instructions have to be written in a programming language? The reason is simple.

The English language was invented for humans to communicate with each other, and since the computer cannot understand human languages, the computer cannot understand English instructions. To bridge this gap, programming languages were invented so that humans could use computers to solve problems. As the Principles book points out, programming languages are notations used for communicating algorithms between people and computers. There are hundreds of programming languages and, to give you a taste of these, Figures of the Principles book show an example of the same program expressed in six different programming languages.

“Real world” and “Abstract World”

One view of programming, is as a way of dealing with the “real” world by using a computer to build an abstract analogy of it. It is said to be “abstract” because it has been abstracted— taking only the parts that are essential to solve the problem at hand —from the real world original. The real world is said to be “modeled” by the abstract world. The real world contains items of data such as time, money, grades, etc. whereas the abstract world treats these data as “black” boxes containing numbers and other symbols. The real world allows actions on these objects, including counting, measuring, sharing and sorting, which may also be modeled in the abstract world. A person is not a number. A map is not reality; much is left out —this is the process of abstraction, illustrated by Figure.

Reality vs. Abstraction

Reality vs. Abstraction

Communication in the real world is between people, and is possible even if there are some errors of spelling, punctuation, grammar or some imprecision. This is possible because we all have enough knowledge about the real world to correct the errors as we go. Generally, this error correction happens so naturally and fast that we don’t even notice it. Communication of a program in the abstract world, between users and computers, is impossible if there is any error of spelling, punctuation, etc.

Computers and programming languages, are at present, rather intolerant of errors and have very little automatic error correcting ability; however, they can often pinpoint the errors for the users to correct. The stages involved in successfully programming an abstract model of the real world is shown in the next section.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Pascal programming Topics