Programming Session 6 LBSC 690 Information Technology.

Slides:



Advertisements
Similar presentations
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Advertisements

Designing a Program & the Java Programming Language
PHP I.
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
Programming Class 9 LBSC 690 Information Technology.
Programming Week 9 LBSC 690 Information Technology.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
The Analytical Engine Module 6 Program Translation.
LBSC 690 Session #10 Programming, JavaScript Jimmy Lin The iSchool University of Maryland Wednesday, November 5, 2008 This work is licensed under a Creative.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Programming Week 5 LBSC 690 Information Technology.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Programming Week 5 LBSC 690 Information Technology.
Structured Programming and UML Overview Session 2 LBSC 790 / INFM 718B Building the Human-Computer Interface.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
LBSC 690: Session 10 Programming, JavaScript Jimmy Lin College of Information Studies University of Maryland Monday, November 12, 2007.
Databases Week 6 LBSC 690 Information Technology.
Programming Week 6 LBSC 690 Information Technology.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
WWW and Internet The Internet Creation of the Web Languages for document description Active web pages.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
Course: Introduction to Computers
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
Programming Languages Lecture 12. What is Programming?  The process of telling the computer what to do  Also known as coding.
INTRODUCTION TO WEB DATABASE PROGRAMMING
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Chapter Lead Black Slide Powered by DeSiaMore Powered by DeSiaMore.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
High-level Languages.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
CS101 Introduction to Computing Lecture Programming Languages.
1.8History of Java Java –Based on C and C++ –Originally developed in early 1991 for intelligent consumer electronic devices Market did not develop, project.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
Visual C++ Programming: Concepts and Projects
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 4 Computer Software.
 Programming Language  Object Oriented Programming  JAVA – An Introduction  JAVA Milestones  JAVA Features.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Chapter 1: Introduction to Computers and Programming.
Lecture 1 Introduction Richard Gesick.
Programming Concepts and Languages
Chapter 4 Computer Software.
Week 5 LBSC 690 Information Technology
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Class 5 LBSC 690 Information Technology
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

Programming Session 6 LBSC 690 Information Technology

Agenda Questions The mythical person-month History of programming Object oriented programming Programming for the Web JavaScript example

Software Software models aspects of reality –Input and output represent the state of the world –Software describes how the two are related Examples –Ballistic computations –Alta Vista –Microsoft Word

Programming Languages Used to specify every detail of the model Special purpose –Able to specify an entire class of models Spreadsheets (Excell, Quatro Pro,...) Databases (Access, Paradox, Oracle,...) General purpose –Able to specify any possible model Pascal, C, Java, JavaScript, Perl,...

The Mythical Person-Month If it would take one person three months, why does it take four people SIX months? –The original estimate might have been too low –Partitioning strategy led to a long “critical path” –Training new people takes each some time –More people means more communications

Training Time Simple Example –Full time person = 2,000 hours/year –Part time person = 288 hours per year –No training  7 part time people –With training  10 part time people Learning the specification takes time –Learning organizational “rules” takes longer!

Communications Sort of like continuous training –Who needs to know what I just learned? Can be minimized by good partitioning –Limit the number of interfaces Can be facilitated by computers –Asynchronous communication techniques , private newsgroups, voice mail

Estimating Completion Time Rules of thumb –1/3 specification –1/6 coding –1/2 test planning, testing, and fixing! Add time for coding to learn as you go, but don’t take time away from the other parts! –Reread the section on “gutless estimating” if you are tempted

History of Programming Machine code –Zeroes and Ones Assembly language –“Assembler” changes names to machine code High-level languages –“Compiler” translates math to machine code Independent of machine “architecture” –FORTRAN, COBOL

History of Programming Structured Programming –Group instructions into meaningful abstractions –C, Pascal, Perl Object oriented programming –Group “data” and “methods” into “objects” –Naturally represents responses to events –C++, Java, JavaScript

Object Models Represent things in the world as “objects” –Simplest objects are “variables” Represented with a name (n, teacher, …) May be assigned a value (n=4, teacher=“Doug”, …) Represent actions with “methods” –Simplest methods are “operations” Represented with a symbol (+, -, *, /, …) “Classes” group objects with methods –Classes model how kinds of things behave Objects are instances of classes

A Simple Example Variables: Height, Weight, Shoe size Operations: Multiply, Divide Method: Shoe size=4*Weight/Height Class: Person Object: George

Statements Simple assignment statements Birds = Hawks + Orioles Statements that invoke a method document.write(“Hello World!”) Return a value from a method return Birds

Combining Statements to Make Methods Sequential {… ; …; …; …} Conditional if (i= =3) then {…} else {…} try {…} catch (exception e) {…} Loop for (i=0;i<10;i++) {…} do {…} while (i<5)

Events Models an external stimulus –program initiation, mouse click, mouseover, … Events result in the activation of a method –Methods register the events to which they respond Conceptually, methods can run in parallel –In practice, computers do one thing at a time

Arrays A set of elements –For example, the number of days in each month Each element is assigned an index –A number used to refer to that element For example, x[4] is the fifth element - count from zero –Arrays and loops work naturally togther

Programming for the Web Common Gateway Interface (CGI) [Server side] –Forms encode field values into a URL –CGI passes field values to a Perl program –Program generates a web page as a response JavaScript [Client-side, interpreted] –Human-readable “source code” sent to the browser –Web browser runs the program Java applets [Client-side, compiled] –Machine-readable “bytecode” sent to browser –Web browser runs the program

Your First JavaScript Program Launch a web browser –Internet Explorer would be the best choice See how it behaves if you are 13 (or 65) View source and read the program Copy it to your../pub directory on WAM Make some changes and see how it works

Why Java? Java applets transfer and run faster –“Bytecode” is more compact and easier to run Java applets can send and receive data –A security policy limits what can be sent, though In Java you can create new classes –This is helpful when writing complex programs Java strictly enforces data types –This prevents some common kinds of mistakes You can stretch a statement over several lines –Put a “;” at the end of each Java statement

Java Bytecode “Machine language” depends on the machine –Programs compiled for a Sun won’t work on a PC Java claims “write once, run anywhere” –Without recompiling JavaScript interpreters are slow –Because they must read every character every time Java compiles to a standardized bytecode –Which is organized like most machine languages

The Key Ideas Programming languages can model any problem –Completely specifies output the for any input Object orientation matches human thought well –Objects and actions are paired –Simple control structures facilitate abstraction Events, sequential execution, conditional, iteration Language choice depends on the task –For the Web: CGI (Perl), JavaScript, Java