Unformatted text preview:

Introduction to C CS 2022 Introduction to C Instructor Hussam Abu Libdeh based on slides by Saikat Guha Fall 2011 Lecture 1 Introduction to C CS 2022 Fall 2011 Lecture 1 Administrivia I I I I I Instructor Hussam Abu Libdeh 4139 Upson Email hussam cs cornell edu Meeting times Mondays 12 20 1 10pm 245 Olin Hall Wednesdays 12 20 1 10pm 245 Olin Hall Fridays 8 00 8 50am 361 Upson Hall Duration 8 24 9 23 Office Hours To Be Determined http cms csuglab cornell edu Introduction to C CS 2022 Fall 2011 Lecture 1 Pre requisites I I Basic programming knowledge variables functions loops Lots of composure I I I I I Your programs won t compile Your programs won t run Your programs will crash You ll have no idea what happened but at least it ll happen fast Introduction to C CS 2022 Fall 2011 Lecture 1 History of C I Writing code in an assembler gets real old real fast I I I BCPL by Martin Richards Grandparent of C I I I Really low level no loops functions if then else Not portable different for each architecture Close to the machine Procedures Expressions Statements Pointers B by Ken Thompson Parent of C I I Simplified BCPL Some types int char Introduction to C CS 2022 Fall 2011 Lecture 1 History of C I C by Kernighan and Ritchie I I I I I Much faster than B Arrays Structures more types Standardization Portability enhanced Parent of Objective C Concurrent C C C Introduction to C CS 2022 Fall 2011 Lecture 1 When to use C I Working close to hardware I I I Need to violate type safety I I I Operating System Device Drivers Pack and unpack bytes Inline assembly Cannot tolerate overheads I I I I No No No No garbage collector array bounds check memory initialization exceptions Introduction to C CS 2022 Fall 2011 Lecture 1 When not to use C Use JAVA or C for I Quick prototyping I I I Python or Ruby are even better here Compile once Run Everywhere Reliability is critical and performance is secondary I I C can be very reliable but requires tremendous programmer discipline For many programs JAVA can match C performance but not always Introduction to C CS 2022 Fall 2011 Lecture 1


View Full Document

CORNELL CS 2022 - CS 2022 Introduction to C

Loading Unlocking...
Login

Join to view CS 2022 Introduction to C and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 2022 Introduction to C and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?