One of the most interesting aspects of writing programs is deciding how to solve a particular problem, especially when there are multiple solutions.įor example, there are numerous ways to sort a list of numbers, and each way has its advantages. The process continues until the subtasks are simple enough to be performed with the basic instructions provided by the computer. So you can think of programming as the process of breaking down a large, complex task into smaller and smaller subtasks. Repetition: Perform some action repeatedly, usually with some variation.īelieve it or not, that’s pretty much all there is to it.Įvery program you’ve ever used, no matter how complicated, is made up of small instructions that look much like these. Math: Perform basic mathematical operations like addition and division.ĭecisions: Check for certain conditions and execute the appropriate code. Output: Display data on the screen, or send data to a file or other device. input: Get data from the keyboard, a file, a sensor, or some other device. The details look different in different languages, but a few basic instructions appear in just about every language. It can also be a symbolic computation, like searching and replacing text in a document or (strangely enough) compiling a program. The computation might be something mathematical, like solving a system of equations or finding the roots of a polynomial. On one level you will be learning to program, a useful skill by itself.īut on another level you will use programming as a means to an end.Īs we go along, that end will become clearer.Ī program is a sequence of instructions that specifies how to perform a computation. That’s why this chapter is called, “The way of the program”. It involves the ability to formulate problems, think creatively about solutions, and express solutions clearly and accurately.Īs it turns out, the process of learning to program is an excellent opportunity to develop problem solving skills. The single most important skill for a computer scientist is problem solving. Like engineers, they design things, assembling components into systems and evaluating trade-offs among alternatives.Īnd like scientists, they observe the behavior of complex systems, form hypotheses, and test predictions. Like mathematicians, computer scientists use formal languages to denote ideas, specifically computations. This way of thinking combines some of the best features of mathematics, engineering, and natural science. The goal of this book is to teach you to think like a computer scientist.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |