lecture 1d

16
Administrivia About the Course Python Environment Python Programming Language Resources Omar Khan COMP 102 Structure and Interpretation of Computer Program

Upload: shaheer-shahzad

Post on 24-Jan-2016

35 views

Category:

Documents


0 download

DESCRIPTION

scdsc

TRANSCRIPT

Page 1: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 2: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

COMP 102Structure and Interpretation of

Computer Programs

Omar Khan

Lecture 1September 01, 2015

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 3: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Announcement

The Academic Office added late our two new math courses MATH111, and, STAT 115. Freshmen need to be told to add either ofthe two (there are 2 Calculus sections and one Probability section)and to drop one of their currently chosen courses by going to theAcademic Office who will help them do that.Some have alreadydone this last week but the rest need to. It’s compulsory.Otherwise their degrees will be late.

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 4: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Staff

Lecturer:Omer Khanemail: [email protected]: S302office hours: W F: 1:00pm - 2:00pm

Teaching Assistants:

Arslan Amjademail: arslan [email protected]

Usama Shafqatemail: [email protected]

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 5: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Course Websites

Course Homepage:

https://sites.google.com/site/comp102fall2015/

Primary source for handouts, policies, calendar etc

Course Discussion Group:

https://Piazza.com

First place to ask questions and communicate with thestaff/class

You should now line up and give your emails to one of the TAs

One of the TAs will also give you a tutorial on how to use thissite

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 6: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Course Logistics

Designed for people who are serious about learning computerscience

Fast Paced. Have to work hard (high fail rate if you dont)

No spoon feeding, you have to try to learn yourself we arehere to help

Weekly Homeworks

Project with Partners

Surprise Quizzes

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 7: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Grading

Marks Distribution:

Homeworks 10%

Projects 15%

Quizzes 20%

Midterm 20%

Final 35%

Grading:I will probably mark on a relative scale but the grade distributionwill be close to the following:

A: 80-100; B: 70-79; C: 60-69; D: 40-59; F:0-39

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 8: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Computer Science

Neither a Science, Nor about computers

Computer Science is the Study of:

Computation Models and what problems can be solved usingcomputationHow to solve those problemsWhat design choices lead to effective solutions.

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 9: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

This Course

Iqbal, Bal-e-Jibril (1935)

Programs must be written for people to read, and onlyincidentally for machines to execute.

Harold Abelson, Structure and Interpretation of Computer Programs (1995)

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 10: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

This Course

Not about learning the syntax of a Particular Language

How to control Complexity of large Programs

How to express ideas about clearly

End Goal: Should be able to read and alter large well writtenprograms

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 11: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Fun with Python

I think that it’s extraordinarily important that we incomputer science keep fun in computing. When itstarted out, it was an awful lot of fun. Of course, thepaying customers got shafted every now and then, andafter a while we began to take their complaintsseriously. We began to feel as if we really wereresponsible for the successful, error-free perfect use ofthese machines. I don’t think we are. I think wereresponsible for stretching them, setting them off innew directions, and keeping fun in the house. I hopethe eld of computer science never loses its sense of fun.

Alan J. Perlis

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 12: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Python Interpreter

We will work with a program called a Python interpreter. For themoment imagine that the Python interpreter is a humanoid robot,let us name it Py.Py has the following characteristics:

It has no memory (that is it can’t remember anything you askit to remember)

It can evaluate a limited form of expressions or instructions.

It has a bunch of scratch pads on which it can write stuff.

It only evaluates the expressions/instructions you give it.

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 13: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Interacting with Py

There are two ways to interact with Py (the Python Interpreter)

REPL (read-evaluate-print-loop)prints the result of the evaluation and is ready for the nextinstruction

Giving it file of instruction to evaluate Evalutes and stops

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 14: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Means of Combination and Abstraction

The acts of the mind, wherein it exerts its power oversimple ideas, are chiey these three:- Combining several simple ideas into one compoundone, and thus all complex ideas are made.- The second is bringing two ideas, whether simple orcomplex, together, and setting them by one another soas to take a view of them at once, without unitingthem into one, by which it gets all its ideas of relations.- The third is separating them from all other ideas thataccompany them in their real existence: this is calledabstraction, and thus all its general ideas are made.

John Locke, An Essay Concerning HumanUnderstanding (1690)

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 15: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Means of Combination and Abstraction

How do you combine simple ideas to form complex ones?Every powerful language has three mechanisms for accomplishingthis:

primitive elements, which represent the simplest entities thelanguage is concerned with,

means of combination, by which compound elements are builtfrom simpler ones, and

means of abstraction, by which compound elements can benamed and manipulated as units.

Omar Khan COMP 102 Structure and Interpretation of Computer Programs

Page 16: Lecture 1d

AdministriviaAbout the Course

Python EnvironmentPython Programming Language

Resources

Functions and Data

In Programming we deal with two kinds of elements

DATA:Informally, data is stuff that we want to manipulate(Shakespear text)

FUNCTIONS:descriptions of the rules for manipulating the data (read, len)

Any powerful programming language should be able to describeprimitive data and primitive functions and should have methods forcombining and abstracting Functions and data.

Omar Khan COMP 102 Structure and Interpretation of Computer Programs