COMP 201: Principles of Programming

Similar documents
Programming Languages, Summary CSC419; Odelia Schwartz

CS558 Programming Languages

Programmazione Avanzata

Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

Languages october 22, 2017 Éric Lévénez < FORTRAN III end-1958 FORTRAN II FORTRAN I october 1956

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Introduction. A. Bellaachia Page: 1

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Concepts in Programming Languages

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2015 Euiseong Seo

LECTURE 1. Overview and History

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

Low-Level Languages. Computer Programs and Programming Languages

Objective: To learn meaning and concepts of programming. Outcome: By the end of this students should be able to describe the meaning of programming

Com S 541. Programming Languages I

CSc 372 Comparative Programming Languages

Compilation 2012 The What and Why of Compilers

Programming Languages 2nd edition Tucker and Noonan"

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Introduction to Computer Science I

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

CSCI 3136 Principles of Programming Languages

Programming (ERIM) Lecture 1: Introduction to programming paradigms and typing systems. Tommi Tervonen

CS383 PROGRAMMING LANGUAGES. Kenny Q. Zhu Dept. of Computer Science Shanghai Jiao Tong University

Programming Language Concepts 1982, 1987, Outline. Period

Lecture 1: Course Introduction

Lecture 01 & 02 Computer Programming

Introduction to Scientific Computing Languages

Programming (Econometrics)

Concepts of Programming Languages

Introduction to Scientific Computing Languages

PLAGIARISM. Administrivia. Course home page: Introduction to Programming Languages and Compilers

Introduction to Programming Languages and Compilers. CS164 11:00-12:00 MWF 306 Soda

Describe the layers of a computer system

Discovering Computers Chapter 13 Programming Languages and Program Development

Introduction to Computer Programming Using FORTRAN 77

Mechanization. A little bit of history. Mechanization. The old dream of mechanical computing. Jordi Cortadella Department of Computer Science

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

A little bit of history. Jordi Cortadella Department of Computer Science

Discovering Computers 2008

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

A Set Of Machine Language Instructions For A Program Is Called Source Code >>>CLICK HERE<<<

Language Translation, History. CS152. Chris Pollett. Sep. 3, 2008.

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

What is a programming language?

Chapter 6 Control Flow. June 9, 2015

G Programming Languages - Fall 2012

CS101 Introduction to Programming Languages and Compilers

SOFTWARE ARCHITECTURE 6. LISP

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Continuations provide a novel way to suspend and reexecute

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

CS A331 Programming Language Concepts

An Introduction To Programming With Visual Basic 2012 Ebooks Free

Programmiersprachen (Programming Languages)

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

Lecture 1: Course Introduction

INSTITUTE OF AERONAUTICAL ENGINEERING

More Lambda Calculus and Intro to Type Systems

MySQL. The Right Database for GIS Sometimes

CSI32 Object-Oriented Programming

Part (04) Introduction to Programming

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Type Inference. Prof. Clarkson Fall Today s music: Cool, Calm, and Collected by The Rolling Stones

CSE 307: Principles of Programming Languages

COMPILER DESIGN LECTURE NOTES

Introducing Computer Programming

! Broaden your language horizons. ! Study how languages are implemented. ! Study how languages are described / specified

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

An Introduc+on to Computers and Java CSC 121 Spring 2017 Howard Rosenthal

Chapter 2 Preview. Preview. History of Programming Languages. History of Programming Languages. History of Programming Languages

CS240: Programming in C

More Lambda Calculus and Intro to Type Systems

COS 140: Foundations of Computer Science

Chapter Twelve. Systems Design and Development

Seminar in Programming Languages

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed

(0) introduction to the course. how to learn a programming language. (0) course structure

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

Announcements Tues., Aug and 2. to call them ( ) ! For next time, read Learning Computing with Robots, chs.

Lecture 1. Introduction to course, Welcome to Engineering, What is Programming and Why is this the first thing being covered in Engineering?

LECTURE 18. Control Flow

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Inside COM+: Base Services (Microsoft Programming Series) Ebooks Free

A Tour of Language Implementation

Lecture 2. Programs and Pseudocode. Daily Puzzle

Compiler Construction D7011E

Introduction to Engineering Using Robotics Experiments. Dr. Yinong Chen

Why are there so many programming languages?

Administration Computers Software Algorithms Programming Languages

Lecture 1: Overview

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

CITS5501 Software Testing and Quality Assurance Formal methods

CS 3304 Comparative Languages. Lecture 1: Introduction

CSCI.4430/6969 Programming Languages Lecture Notes

Problem Solving and Program Design - Chapter 1. Cory L. Strope

Compilers Project Proposals

CS2303 C14 Systems Programming Concepts. Bob Kinicki

Transcription:

COMP 201: Principles of Programming 1

Learning Outcomes To understand what computing entails and what the different branches of computing are. To understand the basic design of a computer and how it represents information. To understand the different levels of programming languages. To know about the department s program structure and the various courses involved. 2

What is Computing? Organizational Issues & Information Systems Application Technologies Software Methods & Technologies Systems Infrastructure Computer Hardware & Architecture Theory Principles Innovation More Theoretical DEVELOPMENT More Applied Application Deployment Configuration Figure from Computing Curricula 2005, The Overview Report 3

Software Engineering (Computing) Organizational Issues & Information Systems Application Technologies Software Methods & Technologies Systems Infrastructure Computer Hardware & Architecture Theory Principles Innovation More Theoretical DEVELOPMENT More Applied Application Deployment Configuration Figure from Computing Curricula 2005, The Overview Report 4

Computer Engineering (IT) Organizational Issues & Information Systems Application Technologies Software Methods & Technologies Systems Infrastructure Computer Hardware & Architecture Theory Principles Innovation More Theoretical DEVELOPMENT More Applied Application Deployment Configuration Figure from Computing Curricula 2005, The Overview Report 5

(Enterprise) Information Systems Organizational Issues & Information Systems Application Technologies Software Methods & Technologies Systems Infrastructure Computer Hardware & Architecture Theory Principles Innovation More Theoretical DEVELOPMENT More Applied Application Deployment Configuration Figure from Computing Curricula 2005, The Overview Report 6

Computer Science Organizational Issues & Information Systems Application Technologies Software Methods & Technologies Systems Infrastructure Computer Hardware & Architecture Theory Principles Innovation More Theoretical DEVELOPMENT More Applied Application Deployment Configuration Figure from Computing Curricula 2005, The Overview Report 7

How about the Computer? "Computer science is no more about computers than astronomy is about telescopes." Edsger Dijkstra (1930-2002) 8

The Computer Universal Information-Processing Machine Understands Language. Can do anything that we can describe in enough detail. 9

Functional View of Computers Input Devices CPU Output Devices Main Memory Secondary Memory 10

Computer Program A complete, detailed set of steps for the computer to follow. Algorithm: Step by step process to achieve the desired result. Example Task: Find how long it would take to get to Shek O from PolyU. What would the algorithm be? 11

Natural Languages Computer Programs need to be written in a language for the computer to read. Natural Languages: Chinese, English, French, Japanese, etc (Relatively) unstructured syntax Ambiguous semantics I sold my dog biscuits. I saw the man in the park with the telescope. 12

Programming Languages Used for communicating with the computer. Many different kinds, and they all look different, but: Precise Syntax Precise Semantics Adding together two numbers: Load the number from memory location 2001 into the CPU Load the number from memory location 2002 into the CPU Add the two numbers in the CPU Store the result into memory location 2003 13

Computer Communication At the lowest level, computers are made of wires that conduct electricity. The wire is either connected, or not connected. Only two possible values on/off, or high/ low, or 1/0. This is the binary number system. 14

Machine Language At the lowest level, computers speak in binary 1 or 0. This is called machine language. 0110001111000010 Machine Language Program 0001000111100011 : : 0011000100001000 1000001001010101 15

Assembly Language Created as a mnemonic to help humans to write programs. Maps machine instructions to human-readable form Assembler software translates assembly program to binary code. LD R0, #05 ADD R0, $1234 SUB R0, #22 Load the value 5 into the CPU Add the contents of memory location 1234 to the value in the CPU Subtract the value 22 from the value in the CPU LD $1234, R0 Store the value in the CPU into memory location 1234. 16

High-level Programming Languages Designed to be used (and understood) by humans. Needs to be translated into machine language for computers to understand. score = homework + test if (score < 60): print You Failed! else print You Passed! 17

Hierarchy of Languages High-Level Languages Assembly Languages Machine Languages score = homework + test if (score < 60): print You Failed! else print You Passed! LD R0, #05 ADD R0, $1234 SUB R0, #22 LD $1234, R0 0110001111000010 0001000111100011 0011000100001000 1000001001010101 Hardware Level 18

High-level Languages There are a number of high-level languages such as: Java, Perl, C, C++, C#, Ada, Fortran, BASIC, Python, LISP, Scheme, Ruby, etc. And they often look quite different! 19

High-level Programming Languages score = homework + test if (score < 60): print You Failed! else print You Passed! (setq score (+ homework test)) (if (< score 60) (print You Failed! ) (print You Passed! ) ) score = homework + test; if (score < 60) System.out.println( You Failed! ); else System.out.println( You Passed! ); 20

Programming Language History 1956 1958 1960 Cobol Fortran I Algol 60 Lisp 1962 Java? C/C++ General Usage Pascal Teaching COBOL Banking & Finance Fortran Scientific Algol Publication 1964 1966 1968 1970 1972 1974 1976 1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 PL/I Pascal Ada 83 Eiffel Smalltalk C (K&R) Smalltalk 80 C++ Perl Tcl Python Java Ruby Java 2 (v1.2) C++ (ISO) C# Prolog Scheme Fortran 77 Common Lisp Scheme R4RS Fortran 90 ML SML Caml Haskell OCaml 2002 21

History of Programming Languages 1954 1960 1965 1975 1970 1986 www.oreilly.com For more than half of the fifty years computer programmers have been writing code, O Reilly has provided developers with comprehensive, in-depth technical information. We ve kept pace with rapidly changing technologies as new languages have emerged, developed, and matured. Whether you want to learn something new or need answers to tough technical questions, you ll find what you need in O Reilly books and on the O Reilly Network. 1990 1980 1990 1991 1990 1985 1991 1993 1994 1995 1995 1996 1996 1997 2000 1997 2000 2001 2001 2002 2001 2003 2003 2004 2003 2004 This timeline includes fifty of the more than 2500 documented programming languages. It is based on an original diagram created by Éric Lévénez (www.levenez.com), augmented with suggestions from O Reilly authors, friends, and conference attendees. For information and discussion on this poster, go to www.oreilly.com/go/languageposter. 2004 O Reilly Media, Inc. O Reilly logo is a registered trademark of O Reilly Media, Inc. All other trademarks are property of their respective owners. part#30417 22

Programming Language History The fact is, many of those languages (e.g. FORTRAN, BASIC, COBOL) were all the rage at some point in history. Java was hot a few years ago. But debatable whether it s still as hot right now. Seems like a lot of people want php, Ruby, etc. New languages have been invented, will be invented, and will eventually take over. Also, certain fields have their own specialized language(s). Graphics: C; Banking, COBOL; etc 23

For COMP 201 In COMP 201, we will be using Python, a high-level programming language. Why Python? Small Language Set Clean and minimal syntax Hides a lot of the complexity of the computer Can focus more on logic than on syntax issues Gaining momentum in the commercial world 24

Learning to Program Obviously, it is not possible to formally learn (i.e. in a classroom) all possible languages. COMP 201 is the only programming-specific course you ll encounter here at PolyU. You will have to teach yourself a new language at some point. Therefore, it is more important to master programming, rather than a particular language. The principles (logic, sequential thinking, problem solving) remain the same. 25

Programming Languages you ll Meet Later COMP 303 (English,.Net) COMP 309 (C) COMP 201 (Python) COMP 311 (SQL) COMP 305 (C++) COMP 302 (English) COMP 304 (C) COMP 312, 320 (Java) COMP 212 (Assembly) 26

Mastering Programming How do I master programming? Practice, practice, practice. If you don t understand something, try it! Always have a little Test program sitting around, where you can test out little bits of code. Read, read, read There are lots of great online (and free) references out there for programming. If you aren t sure about something, google it! 27

What we ve Learned We know what computing is and what s the difference between Computing, IT and EIS. We have a high-level overview of the different parts of a computer and we know how a computer stores its information. We know why there are different levels of programming languages and what is different between them. We have an idea how the different courses in the department relate and complement each other. 28