CS 541 Lecture -*- Outline -*- * Why study programming language design? ** What does language do for us? (parts of this section shamelessly stolen from R. Lederer's book "The Miracle of Language" (1991, Pocket Books) :-) *** Linguistic relativism (Whorf hypothesis) Whorf said that our language determines what thoughts we can think. Do you agree? (Most linguists today don't agree, they only think that language can influence, not determine thought) See if anyone can come up with something they can think, feel, sense without a name for it. Get a discussion going... If no one answers, you might try asking them about smells (English has few words to describe smells. What should we use in Standard English instead of "he or she"? What does x = x + 1 mean to a math major? In Algol 58 (precursor to Algol 60), assignment statments were written like this: a[i] + 3 * sin(y) =: a[j] Why do you think the americans (:-) on the committee wanted this changed? (Hint: they were FORTRAN programmers) What sense did the Europeans see in writing things this way? (Hint what is the order of eval?) Do you think programs are harder to read nowdays because the Europeans gave in? To what extent is what you think influenced by your language? Make 2 lists of words, one with "white" and one with "black" e.g., black art, white bread, in the black, lily white ... does English determine prejudice? Does it affect it? You could have a similar discussion about sexist terms and/or about right vs. left if you have time... The good news: if language only influences what we think to a small extent, then we can control how we think. Moral: we are the masters of our language (notations). *** automation, language level Which would you rather write a spread-sheet program in: assembly language, C, C++, or LISP? Why? Does the language used to teach introductory programming matter? What about it matters? (e.g., garbage collection, sizes of numbers...) Which would you pick? ** The rhetoric of programming (rhetoric is the study of how to speak and write well) Consider the following FORTRAN program fragment... (The following stolen from Programming with Style, page 1) ------------------ DO 14 I=1,N DO 14 J=1,N 14 V(I,J)=(I/J)*(J/I) ------------------ What does it do? hinges on integer division if I