What Is Computer Science
What Is Computer Science
What Is Computer Science? Problem Solving with Algorithms and Data Structures
On the other hand, the mechanic who must repair your automobile takes a very different point of view. She
not only knows how to drive but must know all of the details necessary to carry out all the functions that
we take for granted. She needs to understand how the engine works, how the transmission shifts gears,
how temperature is controlled, and so on. This is known as the physical perspective, the details that take
tingStarted.html)
place under the hood.
http://interactivepython.org/courselib/static/pythonds/Introduction/WhatIsComputerScience.html
1/2
2/25/2016
What Is Computer Science? Problem Solving with Algorithms and Data Structures
The same thing happens when we use computers. Most people use computers to write documents, send
and receive email, surf the web, play music, store images, and play games without any knowledge of the
details that take place to allow those types of applications to work. They view computers from a logical or
user perspective. Computer scientists, programmers, technology support staff, and system administrators
take a very different view of the computer. They must know the details of how operating systems work,
how network protocols are configured, and how to code various scripts that control function. They must
be able to control the low-level details that a user simply assumes.
The common point for both of these examples is that the user of the abstraction, sometimes also called
the client, does not need to know the details as long as the user is aware of the way the interface works.
This interface is the way we as users communicate with the underlying complexities of the
implementation. As another example of abstraction, consider the Python math module. Once we import
the module, we can perform computations such as
>>> import math
>>> math.sqrt(16)
4.0
>>>
This is an example of procedural abstraction. We do not necessarily know how the square root is being
calculated, but we know what the function is called and how to use it. If we perform the import correctly,
we can assume that the function will provide us with the correct results. We know that someone
implemented a solution to the square root problem but we only need to know how to use it. This is
sometimes referred to as a black box view of a process. We simply describe the interface: the name of
the function, what is needed (the parameters), and what will be returned. The details are hidden inside (see
Figure 1).
(../_images/blackbox.png)
http://interactivepython.org/courselib/static/pythonds/Introduction/WhatIsComputerScience.html
2/2