CPSC 427: Object-Oriented Programming

Similar documents
CPSC 427: Object-Oriented Programming

CPSC 427a: Object-Oriented Programming

Object-Oriented Principles and Practice / C++

CIS* Programming

Study Guide to Exam 2

CS 241 Data Organization using C

CPSC 427a: Object-Oriented Programming

Beijing Jiaotong University CS-23: C++ Programming Summer, 2019 Course Syllabus

Welcome to CS 241 Systems Programming at Illinois

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

CS 241 Data Organization. August 21, 2018

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

Data Structures and OO Development II

Object-Oriented Programming CSCI-UA

Welcome to CS 241 Systems Programming at Illinois

ECE573 Introduction to Compilers & Translators

Client Code - the code that uses the classes under discussion. Coupling - code in one module depends on code in another module

Structure of Programming Languages Lecture 10

Spring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques

ANDROID APPLICATION DEVELOPMENT COURSE Training Program

Operating Systems (ECS 150) Spring 2011

Lab 4: Interrupts and Realtime

Lecture 1: January 22

Lecture 1: January 23

Spring 2018 El Camino College E. Ambrosio. Course Syllabus

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

Course Administration

Advanced Programming Concepts. CIS 15 : Spring 2007

Systems Programming/ C and UNIX

Module: Introduction. Professor Trent Jaeger. CSE543 - Introduction to Computer and Network Security

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

San José State University Department of Computer Science CS151, Object Oriented Design, Section 04, Fall, 2016 (42968)

CMSC433 - Programming Language Technologies and Paradigms. Introduction

Midterm Exam #2 Review. CS 2308 :: Spring 2016 Molly O'Neil

Paradigms of computer programming

CS240: Programming in C

San José State University Department of Computer Science CS-144, Advanced C++ Programming, Section 1, Spring 2018

CS503 Advanced Programming I CS305 Computer Algorithms I

San Jose State University - Department of Computer Science

Data Structures and Algorithms

Introduction. Object-Oriented Programming Spring 2015

Programming Style and Optimisations - An Overview

Object-Oriented Programming for Managers

Good Coding Practices Spring 2018

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

CS4470: Intro to UI Software CS6456: Principles of UI Software. Fall 2006 Keith Edwards

18-642: Code Style for Compilers

TDDD38 - Advanced programming in C++

Introduction (1) COMP 520: Compiler Design (4 credits) Alexander Krolik MWF 13:30-14:30, MD 279

IA010: Principles of Programming Languages

Compulsory course in Computer Science

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

CSE341: Programming Languages Lecture 26 Course Victory Lap. Dan Grossman Spring 2016

QUIZ How do we implement run-time constants and. compile-time constants inside classes?

the gamedesigninitiative at cornell university Lecture 7 C++ Overview

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

18-642: Code Style for Compilers

Outline. Database Management Systems (DBMS) Database Management and Organization. IT420: Database Management and Organization

CSc 2310 Principles of Programming (Java) Jyoti Islam

Asking for information (with three complex questions, so four main paragraphs)

CSE 333 Lecture 1 - Systems programming

COMP-202: Foundations of Programming. Lecture 26: Review; Wrap-Up Jackie Cheung, Winter 2016

Object Oriented Programming

CPSC 545 Computing Systems Project 2: Hungary Eagles Need Feeding Due: April 27 th, 23:59PM

Spring 2017 :: CSE 506. Introduction. Nima Honarmand

Outline. CIS 110: Introduction to Computer Programming. What is Computer Science? What is computer programming? What is computer science?

Programming Assignment IV Due Monday, November 8 (with an automatic extension until Friday, November 12, noon)

CPSC 427: Object-Oriented Programming

C++ Style Guide. 1.0 General. 2.0 Visual Layout. 3.0 Indentation and Whitespace

Compilers for Modern Architectures Course Syllabus, Spring 2015

Assignment 3 ITCS-6010/8010: Cloud Computing for Data Analysis

G52CPP C++ Programming Lecture 7. Dr Jason Atkin

CPSC 427: Object-Oriented Programming

CSE4305: Compilers for Algorithmic Languages CSE5317: Design and Construction of Compilers

CS 113: Introduction to

Introduction to Concurrent Software Systems. CSCI 5828: Foundations of Software Engineering Lecture 08 09/17/2015

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

Objects and Classes Lecture 1

Who are we? Andre Platzer Out of town the first week GHC TAs Alex Crichton, senior in CS and ECE Ian Gillis, senior in CS

CSE 336. Introduction to Programming. for Electronic Commerce. Why You Need CSE336

CMPSC 311- Introduction to Systems Programming Module: Systems Programming

Object-Oriented Programming

CSE 143. Programming is... Principles of Programming and Software Engineering. The Software Lifecycle. Software Lifecycle in HW

CS111: Intro to Computer Science

Transact Qualified Front End Developer

Operating Systems CMPSC 473. Introduction January 15, Lecture 1 Instructor: Trent Jaeger

CS415 Compilers Overview of the Course. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

COMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University

9 th CA 2E/CA Plex Worldwide Developer Conference 1

CPSC 427: Object-Oriented Programming

Introduction to Concurrent Software Systems. CSCI 5828: Foundations of Software Engineering Lecture 12 09/29/2016

Lecture 1: Welcome! CSE 373: Data Structures and Algorithms CSE WI - KASEY CHAMPION 1

CSE 333 Lecture 1 - Systems programming

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

CMSC201 Computer Science I for Majors

BOSTON UNIVERSITY Metropolitan College MET CS342 Data Structures with Java Dr. V.Shtern (Fall 2011) Course Syllabus

CS 4800: Algorithms & Data. Lecture 1 January 10, 2017

Avi Silberschatz, Henry F. Korth, S. Sudarshan, Database System Concept, McGraw- Hill, ISBN , 6th edition.

CSCI 4250/6250 Fall 2013 Computer and Network Security. Instructor: Prof. Roberto Perdisci

Transcription:

CPSC 427: Object-Oriented Programming Michael J. Fischer Lecture 1 August 31, 2016 CPSC 427, Lecture 1 1/30

About This Course Topics to be Covered Kinds of Programming Why C++? C++ Programming Standards CPSC 427, Lecture 1 2/30

About This Course CPSC 427, Lecture 1 3/30

Where to find information Information about this course is posted on the course website: Syllabus. http://zoo.cs.yale.edu/classes/cs427/2016f/ The main textbook Exploring C++ by Alice Fischer. Lecture notes. Code samples. Homework assignments. The course uses classes v2 for assignments and announcements. It also contains some links to the main course website on the Zoo. The syllabus contains important additional information. Read it! CPSC 427, Lecture 1 4/30

Course mechanics You will need a Zoo course account. Get it now! Assignments will be submitted on classes*v2. Detailed instructions will be provided. Course Requirements: Homework assignments ( 45%), midterm exam ( 20%), final exam ( 35%). CPSC 427, Lecture 1 5/30

Course goals Learn how to answer the following questions: 1. Who programs and why? 2. How long does a program last? 3. What are the characteristics of a good program? 4. When do good programs matter? 5. Why does C++ help one write good programs? Discussion. CPSC 427, Lecture 1 6/30

Who programs and why? People program for different reasons. 1. To get answers to particular problems of interest. 2. To avoid repetitive work when solving several instances of the same problem. 3. To provide tools that others can use. 4. To produce software of commercial value. 5. To provide a mission-critical service. CPSC 427, Lecture 1 7/30

How long does a program last? Three facetious answers: 1. Until it stops being useful. 2. Until nobody maintains it. 3. Far longer than was originally anticipated. CPSC 427, Lecture 1 8/30

What are the characteristics of a good program? 1. Correctness: Does what was intended. 2. Robustness: Handles bad input gracefully. 3. Security: Resists malicious exploits. 4. Isolation: Prevents unintended interactions within itself and with its hardware and software environment. 5. Cleanliness: Code embodies a direct connection between the task and the solution. 6. Efficiency: Makes cost-effective use of computer resources. 7. Clarity: Can be comprehended rapidly by humans. CPSC 427, Lecture 1 9/30

When do good programs matter? The program development lifecycle is a cyclic process: By Dzonatas (Own work) [CC BY-SA 3.0 or GFDL], via Wikimedia Commons CPSC 427, Lecture 1 10/30

Important properties for lifecycle management 1. Modularity related parts are grouped together at each level 2. Non-interference protect unrelated parts from each other 3. Clean, simple, straightforward, understandable code 4. No duplicate code fragments 5. No unnecessary hardware and OS dependencies 6. Follows recognized style guidelines 7. Appropriate comments CPSC 427, Lecture 1 11/30

Why does C++ help one write good programs? 1. Language and core library are standardized and documented. 2. Modularity mechanisms: function and classes. 3. Isolation mechanisms: privacy and const attributes. 4. Constructors/destructors help one avoid memory management errors. 5. Inheritance and templates help one avoid duplicate code. 6. Exceptions separate error handling from normal program flow. 7. Operator extensions and qualified names improve human readability. 8. Tools for improving efficiency inline functions, const, reference types, move semantics, stack-allocated objects, static type checking. CPSC 427, Lecture 1 12/30

Topics to be Covered CPSC 427, Lecture 1 13/30

Major Areas 1. Foundations of C++ (basics of objects and classes). 2. Software toolset. 3. C++ storage model: paradigms for object creation and deletion, pointers, references, lvalues and rvalues, move semantics. 4. Software design process 5. Programming for reliability, testing, debugging. 6. Programming for efficiency. CPSC 427, Lecture 1 14/30

Course goals - practical Learn how to follow instructions, and how to question them if you think they are wrong. Learn how to get a big job done one module at a time. Learn how to use a reference manual. Learn how to design for efficiency and reliability. Learn how to test, analyze, and debug code. Learn how to present your work in a professional manner. Become proficient at C++ programming, starting with a knowledge of C. CPSC 427, Lecture 1 15/30

Course goals - conceptual What object-oriented programming is and isn t. The basic principles and patterns of object oriented design. Learn how C++ differs in syntax and semantics from standard ISO C on the one hand and from other languages with support for OO-programming such as Python, Ruby, and Java. Learn about classes, objects, type hierarchies, virtual functions, templates, and their implementations in C++. The principles behind the exception handler and how to use it. Learn how to use class libraries such as the C++ standard library, boost, GTKmm, etc. CPSC 427, Lecture 1 16/30

Kinds of Programming CPSC 427, Lecture 1 17/30

Problem solving Desired properties of programs for solving problems: Correct outputs from correct inputs Succinct expression of algorithm Simple development cycle Beginning programming courses tend to focus on programs to solve small problems. CPSC 427, Lecture 1 18/30

Software Construction Desired properties of software constructed for widespread use: Correct outputs from correct inputs Robust in face of bad inputs; stable; resilient Economical in resource usage (time and space) Understandable and verifiable code Secure Easily repurposed Easily deployed Maintainable This course will focus on constructing such industrial-strength software. CPSC 427, Lecture 1 19/30

Industrial-Strength Sofware Thousands of lines of code Written by many programmers Over a large span of time Deployed on a large number of computers With different architectures and operating systems Interacting with foreign code and devices CPSC 427, Lecture 1 20/30

Why C++? CPSC 427, Lecture 1 21/30

C/C++ are popular According to the TIOBE Index for August 2016, C and C++ are the 2nd and 3rd most popular programming languages, behind only Java. 1. 1 See TIOBE Index CPSC 427, Lecture 1 22/30

C/C++ is flexible A typical software system is built in layers on top of the raw hardware: 5 Application 4 Application support (libraries, databases) 3 Virtual machine [optional] 2 Operating system 1 System kernel 0 Hardware C/C++ are almost universally used to implement code at levels 1-4. Java is popular for levels 5, but recent additions to C++ make it increasingly attractive for level 5 applications as well. CPSC 427, Lecture 1 23/30

Advantages and disadvantages of C++ C++ allows one to construct stable, reliable, industrial-strength software. Many programming errors are detected by the compiler, resulting in reduced debugging time after the first successful compile. C++ is closer to the machine, making it possible to have better control over resource usage. CPSC 427, Lecture 1 24/30

Downsides of C++ C++ is a big powerful tool that can easily be misused. The C++ programmer must pay attention to how memory is managed. Mistakes in memory management can lead to catastrophic failures and security holes. C++ programs may be longer than other languages because the programmer learns to describe her program more fully. CPSC 427, Lecture 1 25/30

C++ Programming Standards CPSC 427, Lecture 1 26/30

Five commandments for this course From Chapter 1 of Exploring C++ and elsewhere: 1. Use C++ input and output, not C I/O, for all assigned work. 2. Don t use global variables. If you think you need one, ask for help. Your class design is probably defective. 3. Use getter functions sparingly, and only when you have a good reason for doing so. 4. Don t use setter functions. 5. Don t believe a lot of the rules of thumb you may have learned in a Java course or that you read on the internet. CPSC 427, Lecture 1 27/30

Can is not the same as should! From Chapter 1 of Exploring C++: C++ is a very powerful language, which, if used badly can produce projects that are badly designed, badly constructed, and impossible to debug or maintain. Your goal is to learn to use the language well, and with good style. Please read and follow the style guidelines in Section 1.2. Download the two tools files from the website. Read Section 1.3, about the tools library, and use this information to customize your own copy of the tools. CPSC 427, Lecture 1 28/30

Rules for preparing your work 1. Every code file you submit must contain a comment at the top giving the name of the file, your name, the course number, and the assignment number. 2. If your work is based on someone else s work, you must cite them at the top of the file and describe what part(s) of the code are theirs. 3. If you have started from a file that you obtained from someone else and it contains authorship/copyright information, you must leave that information in place. 4. If you have any doubts about the proper way to cite your sources, ask, don t just guess. Stay out of trouble. CPSC 427, Lecture 1 29/30

Rules for submitting your work 1. All submissions must be done from classes v2. 2. Test every line of code you write. It is your job to verify that your entire program works. If you submit a program without a test plan and test output, the TA will assume that it does not compile and will grade it accordingly. 3. Compile and test your program on the Zoo before submission. 4. Supply a Makefile with your code so that a grader can type make and your code will compile and be ready to run. 5. Supply a README file that contains instructions to the grader on how to run and test your code. CPSC 427, Lecture 1 30/30