CSC302 2011S, Class 01: An Introduction to the Course Overview: * What is a programming language? * Why do we study programming languages? * How should we study programming languages? Admin: * For Thursday (or, preferably, before), do the introductory survey. * Reading for Wednesday (respond Tuesday evening): Tate, 2.1-2.2. * Microsoft is giving Thursday's Thursday extra. (Not in CS; Held in CDO or something.) What is a programming language? * An constructed language in which one produces programs [unambiguously precise sets of instructions] that a computing device (mechanical, human, or whatever) can use to solve a task or tasks Do we use programming languages to do more than write instructions? * We sometimes use them to model data Additional issues: * The instructions often get "reduced" to something simpler * And they end up being so simple that they are transparent * We like them to communicate ideas Here are some definintions I've collection. + Hoare (in part): A tool to aid the programmer. + Louden: A notational system for describing computation in machine-readable and human-readable form. + Matsumoto: [T]he means of programming but also enhancers for you mind that shape the way you think about programming. + Reade: One, rather narrow, view is that a program is a sequence of instructions for a machine. We hope to show that there is much to be gained from taking the much broader view that programs are descriptions of values, properties, methods, problems, and solutions. The role of the machine is to speed up the manipulation of these descriptions to provide solutions to particular problems. A programming language is a convention for writing descriptions which can be evaluated. + Rebelsky: A notation for expressing algorithms so that they may be understood by humans and processed by machines. + Stansifer: The purpose of language is communication. Human beings use natural languages to communicate among themselves. Programming languages are used to communicate with literal-minded machines. + Webopedia: A vocabulary and set of grammatical rules for instructing a computer to perform specific tasks. The term programming language usually refers to high-level languages, such as BASIC, C, C++, COBOL, FORTRAN, Ada, and Pascal. Each language has a unique set of keywords (words that it understands) and a special syntax for organizing program instructions. + Wikipedia: A programming language is an artificial language designed to express computations that can be performed by a machine, particularly a computer. Do these add anything to our definition? * A little clarification, but at the cost of concision and conciseness Why do we study them? (We do we devote a class to it?) * Practical: Different languages are better or worse suited to different problems. By learning different languages, we can choose the ones better suited to particular problems. * OOP is better suited to Web programming than imperative * Because Web systems are normally large, and the key aspects of OOP make it easier to manage large systems * Polymorphism, Inheritance, Encapsulation * The language enforces barriers and encourages reuse * Functional languages are better at data-oriented problems * Practical: Jobs: Meet the HR requirement of "Knows Ruby/Java/Python/C/C--/..." * General: It's cool and interesting * Practical: The more languages you know, the easier it is to learn a new one * Although all the languages can eventually do the same thing, learning new ways to do it can change the way we think about problem solving "enhancers for you mind" * Practical: These days, you need to know lots of languages Inner product: Given two vectors (or lists), A and B, compute sum of A[i]*B[i] for (i = 0; i < n; i++) sum += A[i]*B[i] (fold + (map * A B)) Why use one? * for loop is more straightforward * Functional one is "more interesting" * Functional one is closer to the specification * Functional one is easier to parallelize How does one teach this class? * The language of the week approach * The "interpreter of the week" approach * The "lots of key issues" approach * The "primary literature" approach Structure of the class * Weeks 1-8: Language of the Week * Weeks 9-11: Primary Literature and Key Issues * Weeks 12-13: Key Issues and New Languages Through Student Presentations * Week 14: Wrapup