1COS 217: Introduction to Programming Systems2Goals for Today’s Class• Course overview• Introductions• Course goals• Resources• Grading• Policies• Getting started with C• C programming language overview3Introductions• Jaswinder Pal Singh, Ph.D. (Professor)• [email protected] • Robert Dondero, Ph.D. (Lead Preceptor)• [email protected] (cont.)• Muneeb Ali (Preceptor)• [email protected]• Matvey Arye (Preceptor)• [email protected]• Jialu Huang (Preceptor)• [email protected]• Jack Tzu-Han Hung (Preceptor)• [email protected]• Hanjun Kim (Preceptor)• [email protected]• Indraneel Mukherjee (Preceptor)• [email protected]• Richard Wang (Preceptor)• [email protected] Goal 1: “Programming in the Large”• Goal 1: “Programming in the large”• Help you learn how to write large computer programs• Abstraction; Interfaces and implementations• Specifically, help you learn how to:• Write modular code• Hide information• Manage resources• Handle errors• Write portable code• Test and debug your code• Improve your code’s performance (and when to do so)• Use tools to support those activities6Course Goal 2: “Under the Hood”• Goal 2: “Look under the hood”• Help you learn what happens “under the hood” of computer systems• Specifically, two downward tours• Goal 2 supports Goal 1• Reveals many examples of effective abstractionsC LanguageAssembly LanguageMachine LanguageApplication ProgramOperating SystemHardwarelanguagelevelstourservicelevelstour7Course Goals: Why C?• Q: Why C instead of Java?• A: C supports Goal 1 better• C is a lower-level language• C provides more opportunities to create abstractions• C has some flaws• C’s flaws motivate discussions of software engineering principles• A: C supports Goal 2 better• C facilitates language levels tour• C is closely related to assembly language• C facilitates service levels tour• Linux is written in C8Course Goals: Why Linux?• Q: Why Linux instead of Microsoft Windows?• A: Linux is good for education and research• Linux is open-source and well-specified• A: Linux is good for programming• Linux is a variant of Unix• Unix has GNU, a rich open-source programming environment9Course Goals: Summary• Help you to become a...Power Programmer!!!10Resources: Lectures and Precepts• Lectures• Describe concepts at a high level• Slides available online at course Web site• Precepts• Support lectures by describing concepts at a lower level• Support your work on assignments11Resources: Website and Listserv• Website• Access from http://www.cs.princeton.edu• Academics → Course Schedule → COS 217• Listserv• [email protected]• Subscription is required• Instructions provided in first precept12Resources: Books• Required book• C Programming: A Modern Approach (Second Edition), King, 2008.• Covers the C programming language and standard libraries• First edition is not quite so good, but is sufficient• Highly recommended books• The Practice of Programming, Kernighan and Pike, 1999. • Covers “programming in the large”• (Required for COS 333)• Computer Systems: A Programmer's Perspective, Bryant and O'Hallaron, 2003.• Covers “under the hood”• Some key sections are on electronic reserve• Programming with GNU Software, Loukides and Oram, 1997.• Covers tools• All books are on reserve in Engineering Library13Resources: Manuals• Manuals (for reference only, available online)• IA32 Intel Architecture Software Developer's Manual, Volumes 1-3• Tool Interface Standard & Executable and Linking Format• Using as, the GNU Assembler• See also• Linux man command• man is short for “manual”• For more help, type man man14Resources: Programming EnvironmentFriend Center 016or 017 Computerhats.princeton.eduSSHLab TAsLinuxGNU• Option 1YourPgmfedorafez15Resources: Programming EnvironmentYour PC/Mac/LinuxComputerSSH• Option 2hats.princeton.eduLinuxGNUYourPgmfedorafez16Resources: Programming Environment• Other options• Use your own PC/Mac/Linux computer; run GNU tools locally; run your programs locally• Use your own PC/Mac/Linux computer; run a non-GNU development environment locally; run your programs locally•Etc.• Notes• Other options cannot be used for some assignments (esp. timing studies)• Instructors cannot promise support of other options• Strong recommendation: Use Option 1 or 2 for all assignments• First precept provides setup instructions17Grading• Seven programming assignments (50%)• Working code• Clean, readable, maintainable code• On time (penalties for late submission)• Final assignment counts double (12.5%)• Exams (45%)• Midterm (15%)• Final (30%)• Class participation (5%)• Lecture and precept attendance is mandatory18Programming Assignments• Programming assignments1. A “de-comment” program2. A string module3. A symbol table module 4. IA-32 assembly language programs5. A buffer overrun attack6. A heap manager module7. A Unix shell • Key part of the course• Due (typically) Sundays at 9:00PM• First assignment is available now• Advice: Start early to allow time for debugging …19Why Debugging is Necessary…20PoliciesStudy the course “Policies” web page!!!• Especially the assignment collaboration policies• Violation involves trial by Committee on Discipline• Typical penalty is suspension from University for 1 academic year• Some highlights:• Don’t view anyone else’s work during, before, or after the assignment time period• Don’t allow anyone to view your work during, before, or after the assignment time period• In your assignment “readme” file, acknowledge all resources used• Ask your preceptor for clarifications if necessary21Course Schedule• Very generally…Weeks Lectures Precepts1-2 Intro to C (conceptual) Intro to Linux/GNUIntro to C (mechanical)3-6 “Pgmming in the Large” Advanced C6 Midterm Exam7Recess8-13 “Under the Hood” Assembly LanguagePgmming AssignmentsReading PeriodFinal Exam• See course “Schedule” web page for details22Any questions before we start?23C vs. Java: HistoryBCPL B C K&R CANSI C89ISO C90ISO/ANSI C991960 1970 1972 1978 1989 1999LISP Smalltalk C++ JavaNot yet popular;our compiler supports onlypartiallyWe will use24C vs. Java: Design Goals• Java design goals• Support
View Full Document