1 EECS 231 ADVANCED PROGRAMMING. 2 Staff Instructor Vana Doufexi Ford Building, 2133 Sheridan, #2-229 Teaching Assistant.

Slides:



Advertisements
Similar presentations
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Advertisements

The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
Compiler Construction by Muhammad Bilal Zafar (AP)
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Chapter3: Language Translation issues
Computers: Tools for an Information Age
1 Objectives To introduces the concept of software Design. To introduce the concept of Object- Oriented Design (OOD). To Define various aspects about object.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
Programming Languages Structure
Compiler Construction
Chapter 1 Principles of Programming and Software Engineering.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Java How to Program, 9/e Instructor: José M. Reyes Álamo © by Pearson Education, Inc. All Rights Reserved.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Chapter 17 Programming Tools The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
Copyright © 2002, Systems and Computer Engineering, Carleton University Intro.ppt * Object-Oriented Software Development Unit 1 Course.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Introduction to Object-oriented programming and software development Lecture 1.
Object Oriented Programming Lecturer: Andreas P. Adi
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 10 Architectural Design.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Top-Down Design and Modular Development
Program Design CMSC 201. Motivation We’ve talked a lot about certain ‘good habits’ we’d like you guys to get in while writing code. There are two main.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
SE: CHAPTER 7 Writing The Program
Architectural Design Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Designing Classes. Software changes Software is not like a novel that is written once and then remains unchanged. Software is extended, corrected, maintained,
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.
1 CS 211 Computer Programming II. 2 Staff Instructor Vana Doufexi Ford Building, 2133 Sheridan, #2-229 Teaching Assistant.
1 CS 311 Data Structures. 2 Instructor Name : Vana Doufexi Office : 2-229, Ford Building Office hours: By appointment.
Software Engineering Issues Software Engineering Concepts System Specifications Procedural Design Object-Oriented Design System Testing.
Chapter 1 Introduction Visual Basic.NET. Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi 2 Objectives Explain what Visual Basic is Contrast.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 2 Principles of Programming and Software Engineering.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Binding & Dynamic Linking Presented by: Raunak Sulekh(1013) Pooja Kapoor(1008)
Principles of Programming & Software Engineering
Advanced Computer Systems
CSCI-235 Micro-Computer Applications
Principles of Programming and Software Engineering
Introduction to System Programming
PROGRAMMING METHODOLOGY
Chapter 2. Problem Solving and Software Engineering
Compiler Construction
Chapter 9: Implementation
Presentation transcript:

1 EECS 231 ADVANCED PROGRAMMING

2 Staff Instructor Vana Doufexi Ford Building, 2133 Sheridan, #2-229 Teaching Assistant TBA

3 Class resources Webpage Use it to: download class notes, handouts and assignments look up your grades look up class policies Newsgroup newsgroup name: eecs.231 nntp server: news.cs.northwestern.edu Use it to check announcements discuss class material discuss assignments (but NEVER post solutions)

4 Goals Learn how to design a project (using OOD) Learn C++ Learn how to write clear, well-designed code Learn how to test and debug efficiently Get familiar with development on Unix systems

5 Object-oriented design Main idea: Model the problem as a collection of objects that have certain attributes and interact with one another and the world. Example: Simulating a transportation company that owns trucks and trains. objects (nouns) : truck, train attributes : load, capacity, speed, destination, etc. operations (verbs) : unload, fill up, travel, etc. How about the network of assembly plants, depots, dealerships?

6 Concept: Abstraction Main idea: Focus on the essential details about an entity and consequently on the common elements between entities. Example: Our simulator may consist of a large class of objects called Vehicle. All vehicles share some attributes (e.g. load, capacity) and specific operations may be applied to them (e.g. unload, move_to_destination). There may be several levels of abstraction, each with more detail that the previous level: the Vehicle class consists of two subclasses of objects, the Truck and the Train. Each subclass has its own attributes and operations, specific to it, in addition to the common ones.

7 Concept: Abstraction Big advantages: It enables us to present a general interface, hiding implementation details. It makes it easier to add new types of objects (e.g. Ship as a subclass of Vehicle, Tanker and Car-ferry as subclasses of Ship) Vehicle ShipTrainTruck TankerCar ferry Three levels of abstraction

8 Concept: Reuse Example 2: In what way is a network of warehouses different from or the same as a network of cities used by an airliner? If we already have the abstract design of the airliner's network, can we use that as the basis of our transportation network? Main idea: Use previously designed software in a new application Big advantages: Less development time (and as a result, less cost) More reliable product (the software you are reusing has been tested extensively)

9 Concept: Encapsulation Main idea: Group data together with the operations that can be performed on it and provide a public interface that controls how the data can be used/modified. Big advantages: The object can be modified only though its interface.There are no dangerous dependencies between unrelated components.

10 Concept: Information hiding Main idea: Hide information about a module's structure and implementation from other modules that don't need this information. Big advantages: Other modules are not concerned with the internal design. Example: You don't need to know how the engine works to drive a car. We may modify the implementation without having to modify the way the module interacts with other modules Example: If the "implementation" of the engine changes (e.g. to a diesel engine), the interface (steering wheel, gas pedal, gear box, etc) remains the same.

11 Concept: Maintainability Main idea: Make your program easy to modify in order to correct faults, or adapt it to a changed environments, or improve performance. Abstraction, information hiding, modularity enhance the maintainability of your code. In addition, you should always write clear, readable and easily understandable code.

12 Concept: Readability Main issues: Code formatting (the physical layout of your code) Horizontal and vertical spacing, indentation, line length Naming of identifiers (variables, function names) Use clear, descriptive names. Use nouns for variables, verbs for functions. Avoid shorthand. Comments Describe the intent of the programmer good example: convert dollars to euros bad example: multiply by 1.2 BE CONSISTENT! Do not mix up naming and formatting styles.

13 The compilation process Stage 1: Lexical analysis The compiler identifies individual "tokens" such as identifier names, strings, plus signs, numbers, comments, etc. Errors discovered: unterminated comments/strings, unrecognized symbols. Stage 2: Syntax analysis The compiler identifies the structure of the program and checks whether it satisfies the syntactic rules of the language. Errors discovered: syntax errors, such as missing semi- colons.

14 The compilation process Stage 3: Semantic analysis The compiler identifies the meaning of the program, collects information such as types of variables and performs tests such as type checks. Errors discovered: type errors (e.g. trying to assign a number to a string variable). Stage 4: Code generation The compiler generates object code. (We have skipped a couple of stages that are not important to this discussion)

15 The compilation process Stage 5: Linking The linker combines one or more files containing object code from separately compiled program modules into a single file containing executable code. Errors discovered: missing libraries Finally: Execution The program can now be executed. Errors discovered: run-time errors are caused when your program tries an operation that is not allowed (e.g. when it tries to access a part of memory that it shouldn't). These are not caught by the compiler and are the most difficult to identify and solve. This is where good debugging practices are needed.

16 Debugging Often the most time consuming stage of the developing process. It must be performed in a systematic way. BAD! : Let's try to change this line, to see if it fixes the problem. GOOD! : Let's use the debugger. The debugger can show you what happens inside your program as the latter executes. It allows you to execute your program line by line, make your program stop at a specific point or when a certain condition is satisfied, check the value of an expression at some point.

17 Elements of Programming Languages Variables and types Expressions Assignments Control flow constructs Statements Functions