Code as Language

  Prof Alvarado
   MDST 3705
 22 January 2013
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
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 …
If PHP is a language, then who is the
   speaker and who is the listener?
From Ferdinand Saussure’s Course in General Linguistics (1916)
The computers are here!



                          Mediated communication
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)
This is what writing is too …
The difference is that a computer is a
machine – it harnesses and transfers
               energy
comâ‹…putâ‹…er
  /kəm-pyutər/ [kuhm-pyoo-ter]
–noun
1. 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
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
To perform work, a computer must have
     a representation of the world

But a programmer must first represent
      that world for the computer
What does
  Kirschenbaum
mean by “world”?
Texts “contain” worlds

That is, part of the shared code
 between writer and intended
        reader is a world
“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.”
The cultural logic of worlds is expressed
         in novels in the form of
plots, characters, and an other symbolic
                 devices
            What about code?
10 PRINT CHR$(205.5+RND(1)) : GOTO 10
What world does this line of code
           express?
It also creates a world …
Other Examples
• Conway’s Game of Life
• Barricelli’s Universe
Code is language in the sense language
  both represent and create worlds
PHP as a language
Variables
• Variables are like nouns
• Locations in memory (pigeon holes)
Values
• Values are like meanings
• Strings and numbers
Expressions
• Expressions, e.g. $x + 1, are like clauses
• Expressions always “return” a value
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?”
Sigils
•   E.g. $ as a prefix to variables
•   In CS and Magic
•   Mnemonic devices
•   Hungarian notation
•   Use in other languages
•   Philosophical differences
Plato’s Cave
The Role of Programming

Programming


Programs and Files


Operating System


Hardware (storage, input, output)


Users interact via input and output devices

Mdst3705 2012-01-22-code-as-language

  • 1.
    Code as Language Prof Alvarado MDST 3705 22 January 2013
  • 2.
    Business • Synthetic postsby 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
  • 3.
    Review • Knowledge andMedia – 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 …
  • 4.
    If PHP isa language, then who is the speaker and who is the listener?
  • 5.
    From Ferdinand Saussure’sCourse in General Linguistics (1916)
  • 6.
    The computers arehere! Mediated communication
  • 7.
    When we writecode, we are speaking to the computer, who then speaks to us We are also writing to others who will read the code (including ourselves)
  • 8.
    This is whatwriting is too …
  • 9.
    The difference isthat a computer is a machine – it harnesses and transfers energy
  • 11.
    com⋅put⋅er /kəm-pyutər/[kuhm-pyoo-ter] –noun 1. 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
  • 12.
    Computer languages encodea kind of labor Programming is about creating and controlling this new kind of labor It is writing in the imperative mode
  • 13.
    To perform work,a computer must have a representation of the world But a programmer must first represent that world for the computer
  • 14.
    What does Kirschenbaum mean by “world”?
  • 17.
    Texts “contain” worlds Thatis, part of the shared code between writer and intended reader is a world
  • 18.
    “We hold thesetruths 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.”
  • 20.
    The cultural logicof worlds is expressed in novels in the form of plots, characters, and an other symbolic devices What about code?
  • 21.
  • 22.
    What world doesthis line of code express?
  • 23.
    It also createsa world …
  • 27.
    Other Examples • Conway’sGame of Life • Barricelli’s Universe
  • 29.
    Code is languagein the sense language both represent and create worlds
  • 30.
    PHP as alanguage
  • 31.
    Variables • Variables arelike nouns • Locations in memory (pigeon holes)
  • 32.
    Values • Values arelike meanings • Strings and numbers
  • 33.
    Expressions • Expressions, e.g.$x + 1, are like clauses • Expressions always “return” a value
  • 34.
    Sentences • Code iswritten 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?”
  • 35.
    Sigils • E.g. $ as a prefix to variables • In CS and Magic • Mnemonic devices • Hungarian notation • Use in other languages • Philosophical differences
  • 36.
  • 38.
    The Role ofProgramming Programming Programs and Files Operating System Hardware (storage, input, output) Users interact via input and output devices

Editor's Notes

  • #25 See http://vimeo.com/26472518
  • #26 PHP Version
  • #29 http://rhizome.org/editorial/2011/sep/6/essay-alexander-r-galloway-nils-aall-barricelli-ca/Barricelli experiment recreated with Processing by Galloway. Barricelli’s visualization technique has been altered—color has been added to show the gene groups more clearly, and the vertical axis has been compressed to increase the amount of evolutionary time that is visible. Each swatch of textured color within the image indicates a different organism. Borders between color fields mean that an organism has perished, been born, mutated, or otherwise evolved into something new