You are on page 1of 16

Administrivia

About the Course


Python Environment
Python Programming Language
Resources

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

COMP 102
Structure and Interpretation of
Computer Programs
Omar Khan

Lecture 1
September 01, 2015

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Announcement

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

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Staff
Lecturer:
Omer Khan
email: omerkhan@fccollege.edu.pk
office: S302
office hours: W F: 1:00pm - 2:00pm
Teaching Assistants:
Arslan Amjad
email: arslan 21@rocketmail.com
Usama Shafqat
email: cloudwraith1@gmail.com
Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python 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 the


staff/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 this
site
Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Course Logistics

Designed for people who are serious about learning computer


science
Fast Paced. Have to work hard (high fail rate if you dont)
No spoon feeding, you have to try to learn yourself we are
here to help
Weekly Homeworks
Project with Partners
Surprise Quizzes

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Grading
Marks Distribution:
Homeworks
Projects
Quizzes
Midterm
Final

10%
15%
20%
20%
35%

Grading:
I will probably mark on a relative scale but the grade distribution
will 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 Program

Administrivia
About the Course
Python Environment
Python 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 using
computation
How to solve those problems
What design choices lead to effective solutions.

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

This Course

Iqbal, Bal-e-Jibril (1935)

Programs must be written for people to read, and only


incidentally for machines to execute.
Harold Abelson, Structure and Interpretation of Computer Programs (1995)

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python 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 written
programs

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Fun with Python


I think that its extraordinarily important that we in
computer science keep fun in computing. When it
started out, it was an awful lot of fun. Of course, the
paying customers got shafted every now and then, and
after a while we began to take their complaints
seriously. We began to feel as if we really were
responsible for the successful, error-free perfect use of
these machines. I dont think we are. I think were
responsible for stretching them, setting them off in
new directions, and keeping fun in the house. I hope
the eld of computer science never loses its sense of fun.
Alan J. Perlis

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Python Interpreter
We will work with a program called a Python interpreter. For the
moment 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 cant remember anything you ask
it 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 Program

Administrivia
About the Course
Python Environment
Python 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 next
instruction
Giving it file of instruction to evaluate Evalutes and stops

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python Programming Language
Resources

Means of Combination and Abstraction


The acts of the mind, wherein it exerts its power over
simple ideas, are chiey these three:
- Combining several simple ideas into one compound
one, and thus all complex ideas are made.
- The second is bringing two ideas, whether simple or
complex, together, and setting them by one another so
as to take a view of them at once, without uniting
them into one, by which it gets all its ideas of relations.
- The third is separating them from all other ideas that
accompany them in their real existence: this is called
abstraction, and thus all its general ideas are made.
John Locke, An Essay Concerning Human
Understanding (1690)
Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python 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 accomplishing
this:
primitive elements, which represent the simplest entities the
language is concerned with,
means of combination, by which compound elements are built
from simpler ones, and
means of abstraction, by which compound elements can be
named and manipulated as units.

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

Administrivia
About the Course
Python Environment
Python 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 describe
primitive data and primitive functions and should have methods for
combining and abstracting Functions and data.

Omar Khan

COMP 102 Structure and Interpretation of Computer Program

You might also like