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
35
Embed
2005.02.08 - SLIDE 1IS146 - Spring 2005 Computation: Programming Concepts Prof. Marc Davis & Prof. Peter Lyman UC Berkeley SIMS Tuesday and Thursday 2:00.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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/
• 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
• 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.