Difference between revisions of "Abstraction"

From CS 61A Wiki
Jump to: navigation, search
[checked revision][checked revision]
(created)
 
m ({{Start-class}})
Line 1: Line 1:
 +
{{Start-class}}
 
'''Abstraction''' is a technique to manage complexity. It is based on ''separation of concerns'': organizing programs so that you can work on one thing at a time in isolation.
 
'''Abstraction''' is a technique to manage complexity. It is based on ''separation of concerns'': organizing programs so that you can work on one thing at a time in isolation.
  

Revision as of 12:44, 4 June 2014

Abstraction is a technique to manage complexity. It is based on separation of concerns: organizing programs so that you can work on one thing at a time in isolation.

Data abstraction

Data abstraction refers to inventing new data types and separating functionality from representation.

Process abstraction

Process abstraction refers to higher-order functions expressing computational processes in a compact form.

Examples

Assignment

Assignment binds a name to a value, abstracting away the complexity of the value. Thereafter, the programmer can use the name.

Function

A function encapsulates a behavior, abstracting away the complexity of its implementation. Only inputs and outputs are important to the programmer.

Sources