COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

compilers and interpreters
CS115 Introduction to Programming
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Systems Software.
Programming Types of Testing.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Computers: Tools for an Information Age
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 2: Structure of programs and programming languages as communication.
Guide To UNIX Using Linux Third Edition
COBOL for the 21 st Century Stern, Stern, Ley Chapter 1 INTRODUCTION TO STRUCTURED PROGRAM DESIGN IN COBOL.
Database Management Systems (DBMS)
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Programming Languages: Telling the Computers What to Do Chapter 16.
Languages and Environments Higher Computing Unit 2 – Software Development.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Structured COBOL Programming, Stern & Stern, 9th edition
1 Software Development Topic 2 Software Development Languages and Environments.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
CSC 230: C and Software Tools Rudra Dutta Computer Science Department Course Introduction.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Objective At the conclusion of this chapter you will be able to:
CE Operating Systems Lecture 3 Overview of OS functions and structure.
The LC-3 – Chapter 7 COMP 2620 Dr. James Money COMP
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 05, 2005 Lecture Number: 4.
Language Design Principles and Programming Processing
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Introduction to OOP CPS235: Introduction.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Chapter – 8 Software Tools.
C language + The Preprocessor. + Introduction The preprocessor is a program that processes that source code before it passes through the compiler. It.
Compilers and Interpreters
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
1 / 45 Language Design Principles and Programming Processing Principles of Programming Languages 2.
Principles of Programming & Software Engineering
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Advanced Computer Systems
Visit for more Learning Resources
Chapter 5- Assembling , Linking, and Executing Programs
CSC201: Computer Programming
CSCI-235 Micro-Computer Applications
Compilation and Debugging
Chapter 2: System Structures
Unit# 8: Introduction to Computer Programming
and Executing Programs
Functions, Procedures, and Abstraction
Chapter 1 Introduction(1.1)
Chapter 1 Introduction.
Presentation transcript:

COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing

MANAGING AND REDUCING COMPLEXITY, AND PROGRAM PROCESSING 1.Managing and reducing complexity Problem decomposition Abstraction Contextual checking (strong and heuristic type checking) 2.Programming processing Interpretation v Compilation Libraries Macro processing Debugging tools Program Management Systems and Environments

MANAGING AND REDUCING COMPLEXITY Three techniques: Decomposition – Problem subdivision. Abstraction – Ignoring irrelevant detail. Contextual checking – internal consistency checking. A good programming language supports all three!

PROBLEM DECOMPOSITION Divide and conquer (divide et impera). Problem decomposition hinges on procedures, recursion and parameter passing, and can be applied in most (high level) programming languages.

ABSTRACTION Ignoring irrelevant detail in a safe way (information hiding). Requires the use of an “interface” to abstract away from lower level detail. To do this safely users should have no choice but to abstract away. Abstraction is typically facilitated through the use of packages or modules.

CONTEXTUAL CHECKING Contextual checking is concerned with the contextual correctness of program code. Ideally we would like to check for (and eradicate) all possible “run time” errors, however contextual checking is a difficult undertaking and in some cases (e.g. recursion) completely impractical. Contextual checking consists (typically) of parameter and identifier validation.

STRONG TYPE CHECKING The most successful contextual checking technique to date is strong type checking. Many programming languages require that the type of a data items are specified. Strong type checking is then concerned with the analysis of a program to ensure that all data items are of the correct type. The alternative is weak type checking.

HEURISTIC TYPE CHECKING Heuristic contextual checking is concerned with the application of “rules of thumb”. For example the rule of thumb that all functions must end with a “return statement”, or that all recursive definitions must have at least one base case.

PROGRAM PROCESSING A program written in a high level language (source code) can only be run in its machine code equivalent format. There are two ways of achieving this: 1.Compilation, and 2.Interpretation.

INTERPRETATION Interpretation requires the use of a special program that reads and reacts to source code. Such a program is called an interpreter. During interpretation run-time errors may be detected and “meaningful” error messages produced.

COMPILATION Compilation requires the use of a special program (called a compiler) that translates source code into object code. Sometimes the object code cannot be directly executed. Various library files must be “linked in” using another special program called a linker, which produces executable code. Again various contextual checks are made during compilation.

LIBRARIES Libraries (in computer programming terms) contain chunks of precompiled (object) code for various functions and procedures that come with a programming language that requires compilation. For example functions and procedures to facilitate I/O.

INTERPRETATION VERSUS COMPILATION InterpretationCompilation SlowFast Good error messagingPoor error messaging

MACRO PREPROCESSING A macro comprises a name and a string. During macro preprocessing all occurrences of the name within the program are replaced by the string before interpretation/compilation takes place. Use of macros offers the advantage of enhanced readability. However it is also argued that a well designed language should not require the use of macros!

DEBUGGING TOOLS To assist in error detection many debugging tools exist. Some of these allow the user to anlayse the core dump that occurs in the event of a fatal error. (A core dump describes the “state” of a program when a fatal error occurs). Others allow programmers to step through and execute a program line by line to support analysis of its execution. Overall modern debugging is still in a very unsatisfactory state of development.

PROGRAM MANAGEMENT SYSTEMS Program development comprises a code-writing (using a text editor) and compilation loop, as the programmer attempts to eradicate all detected errors. In a large program, comprising many modules, it makes sense to recompile only those modules that have been changed. The job of a program manager is to monitor which modules require recompilation. The management system is usually integrated with the linker.

PROGRAMMING ENVIRONMENTS To further reduce this development time some vendors have combined a text editor with a compiler/interpreter into a single dedicated programming environment for the production of code in a particular programming language. Such environments include a program management systems and other “administrative” tools (e.g. version control).

SUMMARY 1.Managing and reducing complexity Problem decomposition Abstraction Contextual checking 2.Programming processing Interpretation v Compilation Libraries Macro processing Debugging tools Program Management Systems and Environments