mdst3705 2012-01-22-code-as-language
DESCRIPTION
TRANSCRIPT
![Page 1: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/1.jpg)
Code as Language
Prof Alvarado
MDST 3705
22 January 2013
![Page 2: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/2.jpg)
Business
• Synthetic posts by Friday, Response posts by Monday at 9.
• Is logging on from off grounds an issue?• WordPress tricks
– How to make links– Edit Mode– Adding Media– Adding Code
![Page 3: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/3.jpg)
Review
• Knowledge and Media– Knowledge is embedded in a social process
mediated by literacy and other forms of media– This social process takes place within a
network of people and artifacts– As this network changes, so does what
counts as knowledge
• Hello World!– Your entrance into the knowledge network
called the Web …
![Page 4: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/4.jpg)
If PHP is a language, then who is the speaker and who is the
listener?
![Page 5: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/5.jpg)
From Ferdinand Saussure’s Course in General Linguistics (1916)
![Page 6: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/6.jpg)
The computers are here!
Mediated communication
![Page 7: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/7.jpg)
When we write code, we are speaking to the computer, who then speaks to us
We are also writing to others who will read the code (including ourselves)
![Page 8: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/8.jpg)
This is what writing is too …
![Page 9: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/9.jpg)
The difference is that a computer is a machine – it harnesses and transfers
energy
![Page 10: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/10.jpg)
![Page 11: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/11.jpg)
com⋅put⋅er /kəm-pyutər/ [kuhm-pyoo-ter]–noun1. Also called processor. An electronic
device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations. Compare analog computer, digital computer.
2. A person who computes; computist.Origin:1640–50; compute + -er 1 ; cf. MF computeur
![Page 12: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/12.jpg)
Computer languages encode a kind of labor
Programming is about creating and controlling this new kind of labor
It is writing in the imperative mode
![Page 13: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/13.jpg)
To perform work, a computer must have a representation of the world
But a programmer must first represent that world for the computer
![Page 14: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/14.jpg)
What does Kirschenbaum
mean by “world”?
![Page 15: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/15.jpg)
![Page 16: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/16.jpg)
![Page 17: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/17.jpg)
Texts “contain” worlds
That is, part of the shared code between writer and intended
reader is a world
![Page 18: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/18.jpg)
“We hold these truths to be self-evident, that all men are created
equal, that they are endowed by their Creator with certain unalienable
Rights, that among these are Life, Liberty and the pursuit of
Happiness.”
![Page 19: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/19.jpg)
![Page 20: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/20.jpg)
The cultural logic of worlds is expressed in novels in the form of plots, characters,
and an other symbolic devices
What about code?
![Page 21: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/21.jpg)
10 PRINT CHR$(205.5+RND(1)) : GOTO 10
![Page 22: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/22.jpg)
What world does this line of code express?
![Page 23: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/23.jpg)
It also creates a world …
![Page 24: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/24.jpg)
![Page 25: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/25.jpg)
![Page 26: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/26.jpg)
![Page 27: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/27.jpg)
Other Examples
• Conway’s Game of Life• Barricelli’s Universe
![Page 28: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/28.jpg)
![Page 29: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/29.jpg)
Code is language in the sense language both represent and create
worlds
![Page 30: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/30.jpg)
PHP as a language
![Page 31: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/31.jpg)
Variables
• Variables are like nouns• Locations in memory (pigeon holes)
![Page 32: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/32.jpg)
Values
• Values are like meanings• Strings and numbers
![Page 33: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/33.jpg)
Expressions
• Expressions, e.g. $x + 1, are like clauses• Expressions always “return” a value
![Page 34: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/34.jpg)
Sentences
• Code is written in sentences – Imperative and inquisitive modes
• Imperative– $x = $y; // Like saying, “Let $x = $y”– $x = 1 * 50 + $z;
• Inquisitive– If ($x == 1) {} // Like asking, “Is $x equal to 1?”
![Page 35: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/35.jpg)
Sigils
• E.g. $ as a prefix to variables• In CS and Magic• Mnemonic devices• Hungarian notation• Use in other languages• Philosophical differences
![Page 36: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/36.jpg)
Plato’s Cave
![Page 37: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/37.jpg)
![Page 38: Mdst3705 2012-01-22-code-as-language](https://reader033.vdocument.in/reader033/viewer/2022051609/546e67bfaf7959fb1f8b63a2/html5/thumbnails/38.jpg)
The Role of Programming
Programming
Programs and Files
Operating System
Hardware (storage, input, output)
Users interact via input and output devices