Why do we have to know all that? The stored program concept (the procedural paradigm) Memory

Similar documents
Session 4b: Review of Program Quality

Early programming languages ca. 1960

Week 6: Data. Let's focus first on application domain data.

LECTURE/ STUDY NOTES ON C

Week 2: The Clojure Language. Background Basic structure A few of the most useful facilities. A modernized Lisp. An insider's opinion

Introduction to Programming

Session 3b: Defining data items

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Session 3: Data. Session 3a: Data

Part 3. Why do we need both of them? The object-oriented programming paradigm (OOP) Two kinds of object. Important Special Kinds of Member Function

Why Study Assembly Language?

Introduction. A. Bellaachia Page: 1

Preview from Notesale.co.uk Page 6 of 52

What is a programming language?

Lecture 1: Preliminaries

Week 11: Case study: Designing, building, & testing a Person class Background for the Project Needed in many applications Is it possible? practical?

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

Week 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966?

Introduction to Computers. Joslyn A. Smith

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

ABC Atanasoff-Berry Computer

The. dark side of JAVA. Java bien, j'espère? For what?

Introduction to Basis and Practice in Programming

Machine Architecture and Number Systems CMSC104. Von Neumann Machine. Major Computer Components. Schematic Diagram of a Computer. First Computer?

CS Prof J.P.Morrison

COMP3221: Microprocessors and. Embedded Systems

Ways of documenting Session 5: detailed requirements The Data Dictionary one any The Project A data dictionary Data Dictionary may be maintained

Lecture 1: CS2400 Introduction to Computer Science

Technical concepts. Some basics of computers today. Comp 399

Machine Architecture and Number Systems

Virtual Machines WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO:

Does anyone actually do this?

Fundamental Concepts and History

Object-Oriented Programming Fall Robert Grimm, New York University

CS Computer Architecture

TNBEDCSVIP.IN. S.No CONTEND Page No 1. NUMBER SYSTEM AND BASE CONVERSIONS TYPES OF NUMBER SYSTEM 1. Binary Number System:

Compiler Construction

Basic Programming Language Syntax

CSCI 2132 Software Development. Lecture 2: Introduction to UNIX and Unix-like Operating Systems

CSC 453 Operating Systems

Introduction to Computers, the Internet and the Web Pearson Education, Inc. All rights reserved.

Outline. 1 About the course

In the last few decades, the idea of a computer and what it does for people. has changed tremendously. The development of computers has made

Computer Systems Architecture

CS6601 DISTRIBUTED SYSTEM / 2 MARK

Unit 1: Introduction to Programming. Saurabh Khatri Lecturer Department of Computer Technology VIT, Pune

Why study Programming Language Concepts? Chapter One. Language Evaluation Criteria. Programming Domains. Readability Writability Reliability Cost

Chapter 1. Preliminaries

Chapter 1 Basic Computer Organization

Ways of documenting Session 5: detailed requirements The Data Dictionary one any The Project A data dictionary Data Dictionary may be maintained

COSC 2P95. Introduction. Week 1. Brock University. Brock University (Week 1) Introduction 1 / 18

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

Chapter 1: Introduction

Chapter 1 Preliminaries

1 The Catholic University of Eastern Africa P.o Box , Nairobi Kenya Edward Kioko 2013

Spring 2018 NENG 202 Introduction to Computer Programming

CS 113: Introduction to

Design & Implementation Overview

Session 2. Getting started with a well-structured system specification

Comp 104: Operating Systems Concepts

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

CS120 Computer Science I. Instructor: Jia Song

Administration Computers Software Algorithms Programming Languages

Java: The Complete Reference, J2SE 5 Edition PDF

Do these criteria apply to work in this course?

Defining Data Items Conrad Weisert (2003)

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Overview of Unix / Linux operating systems



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

Getting Started. Chapter 1. Java Programming FROM THE BEGINNING. Chapter 1: Getting Started

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

CSCI170 Lecture 1: Analysis of Programming Languages. John Magee 1 September 2011 Some material copyright Jones and Bartlett

Concepts of Programming Languages

Introduction to Computer Systems

Chapter 1. Preliminaries

Principles of Programming Languages. Lecture Outline

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

Introducing Computer Programming

CSE341: Programming Languages Lecture 17 Implementing Languages Including Closures. Dan Grossman Autumn 2018

Week 7 Prolog overview

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

Computer Fundamentals: Pradeep K. Sinha & Priti Sinha

Operating Systems. Operating Systems

Course and Unix Intro

CS1100 Introduction to Programming

Figure 1-1. A multilevel machine.

CS 360 Programming Languages Interpreters

Programming In Java Prof. Debasis Samanta Department of Computer Science Engineering Indian Institute of Technology, Kharagpur

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

by Pearson Education, Inc. All Rights Reserved.

Object Oriented Concepts and Programming (CSC244) By Dr. Tabbasum Naz

Unit. Programming Fundamentals. School of Science and Technology INTRODUCTION

Chapter 24: Some Compilation Examples

What's that? Why? Is one "better" than the other? Terminology. Comparison. Loop testing. Some experts (e.g. Pezze & Young) call it structural testing

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

Chapter 14 Operating Systems

Transcription:

Session 1b: Background & Preliminaries What is computer programming? The stored-program concept. The procedural paradigm. What is a programming language? The object-oriented paradigm C#: ancestors & origins Why do we have to know all that? The stored program concept (the procedural paradigm) Memory Registers Instructions and data Peripheral devices Addressable main high-speed memory An array of cells that can hold data On most modern computers each cell contains a byte of information. What's that? The cells are consecutively numbered. The number corresponding to a cell is its address. May be volitile or non-volatile. What does that mean? What are bytes? A group of 8 bits (0 or 1) stored together Term originated with the IBM 360 series ~1964. Why 8? What are bits? The simplest unit of data representation in electronic devices: 2 possible values Value can be interpreted as 0 or 1 off or on How many values can a byte represent? How many distinct characters? How many numbers? What if we need more? COMP 170 fall 2013 1-4 copyright 2013 Conrad Weisert

Registers: usual characteristics Temporary volatile storage For a numeric (or other) quantity How many bytes? Higher speed access than main memory Participate in an arithmetic (or other) operation Von Neumann machine architecture The main point is that memory cells or registers can contain a representation of: a. either a data item to be operated upon, interpreted as a number, one or more characters, or individual bits b. or an instruction usually specifying an operation to be performed (such as?), and the location (address) in main memory of a cell containing the data to perform it on An obsolete technique A Von Neumann machine characteristic is that the contents of a memory cell can be treated both as a data item and as an instruction So programs could modify parts of themselves! That's an immensely powerful concept, but It can make programs extremely hard to understand. Fortunately modern machines and modern programming languages eliminate the need (the temptation) for self-modifying programs. We rarely do that any more. Peripheral devices In addition to the central processor and main memory, a computer configuration usually includes attached devices for communicating with the outside world: peripheral devices displays printers modems storage devices disks other mass storage COMP 170 fall 2013 5-8 copyright 2013 Conrad Weisert

Programming languages (simplified overview) Assembly languages Higher-level mainstream languages Pure procedural Object-oriented Examples? Problem-oriented Non-procedural Sometimes called "4th generation" Why are there so many? Where did C# come from? Higher-level programming languages higher than what? Impact of minicomputers, ~1970 need for a smaller language Bell Laboratories and C Kernighan & Ritchie's popular book The object paradigm (OOP) Object-oriented languages as extensions of C Impact of minicomputers Advances in technology made some new machines, compared with $2,000,000 mainframes: physically much smaller much less expensive They could be deployed on submarines, on satellites, in telephone switching centers, etc. But memory was still fairly expensive Affordable size was much too small to run either compilers for powerful programming languages or the typical object programs they produced. What could we do about that? Bell Labs to the rescue! Bell Laboratories, the research part of AT&T, needed to deploy minicomputers: for their own new equipment, such as automated call switching centers for government (defense, etc.) contracts But programming them in assembly languages (each model was different) would be prohibitively expensive. current compilers for PL/I, Ada, or other powerful languages were too big to fit on minicomputers Therefore... COMP 170 fall 2013 9-12 copyright 2013 Conrad Weisert

A new higher-level language was needed It would have to: fit on mini- and micro- computers generate extremely efficient code allow access to machine details It didn't need to support general business or scientific applications Dennis Ritchie and others worked on experimental versions: The first one was called A; it wasn't satisfactory The next one was called B; better but still not good enough. The birth of C They got it right. C was well suited to programming small machines. It allowed low level access to many machine-specific features, without requiring dependence on other details of machine architecture. Kernighan & Ritchie wrote a book describing it. They didn't intend to propose C as a general-purpose language for typical application development But the book was so well written that it became a best seller, and everyone wanted to get C and try it especially on small machines. So, C became a favorite programming language and a candidate for standardization. The C family of O.O programming languages Built upon the syntax and semantics of C Facilitates learning and encourages acceptance Once you know C, then many parts of these languages are familiar. Objective C C++ Java C# To learn them, you focus on the O.O. and other advanced facilities. You already know the rest. Is that an advantage or a handicap? What if you don't know C? Why so many? What does "object oriented" mean? We'll learn the details starting in week 9 It's a way of organizing large programs to minimize interdependencies between data and executable code to facilitate future change with minimum impact It simplifies: both application-domain data and programming constructs What are those? It includes procedural programming, so you have to learn that anyway. COMP 170 fall 2013 13-16 copyright 2013 Conrad Weisert

Includes: C++ Java C# C family of object-oriented programming languages Each of them is built on C C is (almost) a subset of each of them Is that good or bad? What are the main differences? Which one is best? Why C#? Both Java and C++ presented serious shortcomings for large-scale applications: C++ didn't support standard techniques for: web deployment multi-tasking protection against malicious intrusion (viruses) Java did, but making all objects reference data undermined the object paradigm extremely inefficient for many kinds of application-domain object Microsoft origin. Why? It does now! What's that? C# as a better C Bjarne Stroustrup, the principal designer of C++, claimed that one could ignore the object-oriented facilities and use C++ as a purely procedural programming language. That would still be superior to old-fashioned C programming, because C++ had tidied up some other inconsistent, error-prone features. "C++ is a better C" was the argument. That's true also of C# and to a degree Java. That's why the early parts of this course focus on procedural programming. We'll introduce object-oriented concepts later. The downside of C# Although C# corrects many shortcomings of C++ Java, it's still not an ideal language for learning programming: It's too big and complicated It has many features we don't need for typical problems. In this course we shall focus on a useful subset of C#. We shall: ignore features we don't need. choose a sensible subset of the available options. oversimplify or skip over a few troublesome issues. How will that affect our course objectives? COMP 170 fall 2013 17-20 copyright 2013 Conrad Weisert

Our textbook Our own Andrew Harrington and George Thiruvathukal have prepared Introduction to Computer Science in C# You'll find it on web. (no charge) It's unfinished, but it's clear and it provides much of what we'll need. Suggestions for additions and modifications are welcomed. COMP 170 fall 2013 21-24 copyright 2013 Conrad Weisert