35
2005.02.08 - SLIDE 1 IS146 - Spring 2005 Computation: Programming Concepts Prof. Marc Davis & Prof. Peter Lyman UC Berkeley SIMS Tuesday and Thursday 2:00 pm – 3:30 pm Spring 2005 http://www.sims.berkeley.edu/academics/courses/is146/ s05/ IS146: Foundations of New Media

2005.02.08 - SLIDE 1IS146 - Spring 2005 Computation: Programming Concepts Prof. Marc Davis & Prof. Peter Lyman UC Berkeley SIMS Tuesday and Thursday 2:00

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

2005.02.08 - SLIDE 1IS146 - Spring 2005

Computation: Programming Concepts

Prof. Marc Davis & Prof. Peter Lyman

UC Berkeley SIMS

Tuesday and Thursday 2:00 pm – 3:30 pm

Spring 2005http://www.sims.berkeley.edu/academics/courses/is146/s05/

IS146:

Foundations of New Media

2005.02.08 - SLIDE 2IS146 - Spring 2005

Free Pizza Dinner!!!

• Online survey about technology use

2005.02.08 - SLIDE 3IS146 - Spring 2005

New Room Starts Thursday

• 247 Cory Hall

• Entrance on Hearst Street

2005.02.08 - SLIDE 4IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 5IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 6IS146 - Spring 2005

Assignment 2 Check In

• Group names?

• Group members or size?

• Artifact choice questions?

2005.02.08 - SLIDE 7IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 8IS146 - Spring 2005

Assignment 3: Documenting Artifact Usage

• Status update– How is it going?– Any questions on

• Objectives• Questions• Methods• Deliverables

– How is working together in your group?

2005.02.08 - SLIDE 9IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 10IS146 - Spring 2005

Reading Questions

• Papert– What is computation? What does it enable us to do?– What assumptions have you had about computing

and mathematics that Papert is challenging?– How do you use computing today to enhance your

learning at Berkeley?– How could you use computing differently than you do

today to enhance your learning at Berkeley?– Why is programming not taught in the English

department? Should it be? If it were, how would your understanding of language, computation, and New Media change?

2005.02.08 - SLIDE 11IS146 - Spring 2005

Computation and Learning

• Computer-aided instruction– The computer is being used to program the

student

• Constructionism– The student programs the computer– Objects to think with– Microworlds

2005.02.08 - SLIDE 12IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 13IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 14IS146 - Spring 2005

Reading Questions

• Hillis– What is computation? What does it enable us to do?– What is the difference between computation and a

computer?– What are the differences between digital and analog

representations?– What are the various levels of a modern computing

machine?– What are some of the “simple ideas that make

computers work”?– How might these ideas affect your understanding of

language, computation, and New Media?

2005.02.08 - SLIDE 15IS146 - Spring 2005

A Computer Glossary (Video)

• Charles and Ray Eames are considered to be among the finest designers of the 20th century

• They are best known for their groundbreaking contributions to architecture, furniture design, industrial design and manufacturing

• The legacy of this husband and wife team includes more than 75 films that reflect the breadth and depth of their interests

2005.02.08 - SLIDE 16IS146 - Spring 2005

Programming As Representation

• There is a structure of formal symbols that can be manipulated according to a precisely defined and well-understood system of rules

• There is a mapping through which the relevant properties of the domain can be represented by symbol structures

• This mapping is systematic in that a community of programmers can agree as to what a given structure represents

2005.02.08 - SLIDE 17IS146 - Spring 2005

Programming As Representation

• There are operations that manipulate the symbols in such a way as to produce veridical results—to derive new structures that represent the domain in such a way that the programmers would find them accurate representations

• Programs can be written that combine these operations to produce desired results

2005.02.08 - SLIDE 18IS146 - Spring 2005

Levels of Representation

• Physical machine– Wires, chips, disks, or pipes, valves, sinks, or tinker

toys

• Logical machine– And-gates, or Or-gates, inverters, etc.

• Abstract machine– Machine instructions for manipulating stored symbols

• High-level language– Java, C++, Lisp, etc. (operator, data structures, etc.)

• Representation language– Represents primitives and operations about a domain

2005.02.08 - SLIDE 19IS146 - Spring 2005

Algorithms and Programming

• Algorithm– A step-by-step description of a procedure to

achieve a desired result

• Programming– Primitives– Means of combination– Means of abstraction

2005.02.08 - SLIDE 20IS146 - Spring 2005

From Algorithms to Programs

• Algorithm– A step-by-step description of a procedure to

achieve a desired result– How can we walk a square?

• Walk forward• Turn• Walk forward• Turn• Walk forward• Turn• Walk forward

2005.02.08 - SLIDE 21IS146 - Spring 2005

LOGO Square Example

• to square– forward 50– right 90– forward 50– right 90– forward 50– right 90– forward 50– end

2005.02.08 - SLIDE 22IS146 - Spring 2005

LOGO Square Example

• to square– params [size]– forward :size– right 90– forward :size– right 90– forward :size– right 90– forward :size– end

2005.02.08 - SLIDE 23IS146 - Spring 2005

LOGO Window Example

• to window– params [size]– square :size– square :size– square :size– square :size– end

2005.02.08 - SLIDE 24IS146 - Spring 2005

LOGO Window Example

• to window– params [size]– repeat 4 [square :size]– end

2005.02.08 - SLIDE 25IS146 - Spring 2005

LOGO Window Example

• to window– params [size]– make squaresize (:size/2)– repeat 4 [square :squaresize]– end

2005.02.08 - SLIDE 26IS146 - Spring 2005

LOGO Square Example

• to square– params [size]– forward :size– right 90– forward :size– right 90– forward :size– right 90– forward :size– end

2005.02.08 - SLIDE 27IS146 - Spring 2005

LOGO Square Example

• to square– params [size]– forward :size– right 90– forward :size– right 90– forward :size– right 90– forward :size– end

2005.02.08 - SLIDE 28IS146 - Spring 2005

LOGO Square Example

• to square– params [size]– forward :size– right 90– forward :size– right 90– forward :size– right 90– forward :size– end

2005.02.08 - SLIDE 29IS146 - Spring 2005

LOGO Square Example

• to square– params [size]– forward :size– right 90– forward :size– right 90– forward :size– right 90– forward :size– end

2005.02.08 - SLIDE 30IS146 - Spring 2005

LOGO Polygon Example

• to poly – params [sides length]

– repeat :sides [forward :length right (360/:sides)]

– end

2005.02.08 - SLIDE 31IS146 - Spring 2005

LOGO Polywindow Example

• to polywindow– params [sides length] – make polyangle (360/:sides)– repeat (:sides*2) [poly :sides :length right

(:polyangle-180)]– end

2005.02.08 - SLIDE 32IS146 - Spring 2005

Programming Concepts

• Modeling in computational language– Primitives– Means of combination– Means of abstraction

• Basic programming constructs– Parameters– Loops– Procedural abstraction– Subroutines– Conditionals

2005.02.08 - SLIDE 33IS146 - Spring 2005

Hector Jimenez on Hillis

• According to Hillis, most computational functions are based on and/or functions.  To me, this appears to be far from the spectrum of logical possibilities.  It is as if fundamentally they can only see in black and white, no shades of grey.  Am I correct in this analogy?  Has anyone tried to rethink this process or has the technology become too fundamental for all computers.

2005.02.08 - SLIDE 34IS146 - Spring 2005

Lecture Overview

• Assignment Check Ins– Assignment 2: Group Formation– Assignment 3: Documenting Artifact Usage

• Review of Last Time– Computation: History and Ideas

• Today– Computation: Programming Concepts

• Preview of Next Time– Computation: Programming Languages

2005.02.08 - SLIDE 35IS146 - Spring 2005

Reading for Thursday

• Seymour Papert. Mindstorms: Children, Computers, and Powerful Ideas, New York: Basic Books, Inc., 1980, p. 55-134. – Discussion Questions

• Trevor Newhouse