Programming Class 6 LBSC 690 Information Technology Agenda
Programming Class 6 LBSC 690 Information Technology
Agenda • Questions • Programming – The mythical person-month – History of programming – Object oriented programming – Programming exercise in Java. Script
Software • Software in a kind of machine – Translates input to output – Increasingly processing word & multimedia • 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, . . . ) • General purpose – Able to specify any possible model • Pascal, C, Java, . . .
The Mythical Person-Month • If it would take one person three months, why does it take four people SIX months? • Four causes – It wouldn’t have taken 3 months anyhow! – Partitioning strategy – Training time – Communications effort
How long will it take? • 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
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 lots of 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 • Email, BBS, voice mail
History of Programming • Variations describing “instructions and data” • 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” – e. g. , FORTRAN, COBOL
History of Programming • Structured (Modular) Programming – Group instructions into meaningful abstractions – C, Pascal • Object-oriented programming – Group “data” and “methods” into “objects” – Non-linear flow of program – C++, Java
What is Java Script • • Scripts versus compiled languages Well matched with Web browsers Embedded in html, not compiled Java Script is NOT Java – No graphics, no formal classes – No data typing, no modularity
Forms, CGI, and Java. Script • CGI is the “Common Gateway Interface” – in combination with Forms and languages like PERL it lets you create new pages based on user input • Java. Script also lets you do create new pages
select. html • Run – http: //glue. umd. edu/~oard/690/select. html • View Document Source
components of Java. Script • • • Objects Events Values and Variables Assignment Conditionals Looping
What is “Object-Oriented” • Represent things in the world as “objects” – The simplest objects are “variables” • Represent actions with “methods” – The simplest methods are “operations” • “Classes” group objects with methods – Classes model aspects of reality • Objects are instances of classes
A Simple Example • Variables: • Operations: Height, Weight, Shoe size Multiply, Divide • Method: Shoe size=4*Weight/Height • Class: • Object: Person George
Data Types • Lists of elements, each of the same data type – For example, the number of days in each month • Each element is assigned an integer index – The index is used to refer to the element (x[4]) – In Java, the index numbers start at zero • An string acts like an array of characters
Some Basic Operations Negate Add Multiply - int + int * float Compare int < int Compare char == char produces int produces float produces boolean
Java. Script and Java beyond the Examples • Classes • Java security model
The Key Ideas • Programming languages give full control over computers • The picky details beyond the in running programs are often more difficult than the logic of the programming langauge • Networked computing means not just ubiquitous computing, but also ubiquitous information
- Slides: 20