Richard E Sarkis CSC 161: The Art of...

24
Richard E Sarkis CSC 161: The Art of Programming Introduction

Transcript of Richard E Sarkis CSC 161: The Art of...

Page 1: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Richard E Sarkis CSC 161: The Art of Programming

Introduction

Page 2: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Class Overview

Page 3: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Just the Facts, Ma’am

• Mr. Richard Sarkis

[email protected]

• Bausch & Lomb Hall, Room 470

• Take elevators to the 4th floor, make a left and all the way to the end of the hall

Page 4: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Class Organization

• Mix of Blackboard and class website

• Lectures: "expert" insight

• Assignments: Mission Possible

• Project: Have some fun!

• Exams: Test your mettle.

• Quizzes: Hint: go to workshops!

👋👋

Page 5: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Lectures

• See class website for schedule!

• I’ll try to keep it interesting

• Live coding demos

• Questions from the audience

• Class participation is highly encouraged

Page 6: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Syllabus

Page 7: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

What is Computer Science?

Page 8: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Computer Science?

• Everything is bits and computation!

• Astronomy - simulation and observation data

• Biology – Protein folding

• Music – Sound processing

• Mechanical Engineering – Load bearing

• Literature – Text analysis

• What are you studying?

Page 9: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Lies, damned lies…

• Common misconceptions about Computer Science

• Computer science is the study of computers

• Computer science is the study of how to write computer programs

• Computer science is the study of the uses and applications of computers and software

Page 10: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

“What would we like our children- the general public of the future—to learn about computer science in schools? We need to do away with the myth that computer science is about computers. Computer

science is no more about computers than astronomy is about telescopes, biology is about microscopes or

chemistry is about beakers and test tubes. Science is not about tools, it is about how we use them and what we

find out when we do."

Micheal R. Fellows, Ian Parberry (1993) "SIGACT trying to get children excited about CS". in: Computing Research News. January 1993.”

Page 11: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Computer science is…

• …the study of computation.

• Feasibility, structure, expression, and mechanization of the methodical processes (or algorithms) that underlie the acquisition, representation, processing, storage, communication of, and access to information

Page 12: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

What a tool

The computer is just a tool, described and realized by the concepts computer science.

Page 13: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Programming?

Page 14: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

“The art of programming is the art of organizing complexity, of mastering multitude and avoiding its bastard chaos as effectively as

possible.”

Edsger W. Dijkstra (1970) "Notes On Structured Programming" (EWD249), Section 3 ("On The Reliability of Mechanisms"), p. 7.

Page 15: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Programming?

• Simply using off the shelf applications will get you a long way:

• Spreadsheets, Photo editors, word processors

• But if you are doing novel, creative work, sooner or later, you will need to solve a new problem

• Learning good principles of programming will make it possible with more fun and less frustration

• Analogy: Knowing how to cook versus microwaving TV dinners

Page 16: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Programming

• Take a computing problem and create an executable program

• Analyze and understand the problem

• Design a data model and an algorithm

• Data model: way to represent the information

• Algorithm: formal computation steps

• Implement the algorithm in a computer language

Page 17: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Programming

• Programming != solving a problem

• Programming is teaching somebody else how to solve a problem

• “Somebody else” is a computer

• A computer is a device that can be programmed to carry out a finite set of operations on binary numbers

• Computers can’t do anything that they are not programmed to do

Page 18: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Tic-Tac-Toe

• An almost universally known game

• To create a Tic-Tac-Toe program you have to teach a computer:

• The rules of the game

• A strategy to play the game

• (Plus other things, like input/output, etc)

Page 19: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Programming Example

Page 20: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Python?

Page 21: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Python?CSC 161 will give you a practical tool for

your whole career!

Page 22: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Python?

• Python is rapidly becoming a language of choice for:

• Scientists (NASA)

• Web site builders (Reddit)

• Researchers in the humanities (Somebody…)

• Application developers (Dropbox)

Page 23: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Why Python?

• We'll be using Version 3.x

• http://www.python.org

Page 24: Richard E Sarkis CSC 161: The Art of Programmingrsarkis/csc161/_static/lectures/Introduction.pdfTic-Tac-Toe • An almost universally known game • To create a Tic-Tac-Toe program

Questions?