Ch. 10 Software Development (Computer Programming) 1
Definitions Software or Program Instructions that tell the computer what to do Programmer Someone who writes computer programs 2
Instruction Set A vocabulary (list) of instructions which can be executed by the CPU The only instructions the CPU can run or execute different families of CPU s have different instruction sets Example of a CPU s Instruction Set: Instruction* Meaning add a,b,c a = b + c addi a,b,100 a = b+ 100 slt a,b,c if b<c then a=0 else a=1 beq a,b,target if a=b then goto target * symbolic representation the actual instructions are patterns of 0 s and 1 s 3
First Generation Languages (Machine Language) Programming computers using the CPU s instruction set (the instructions written by the programmer are directly run by the processor no translation) Also known as Machine Language Machine Code File A software file which contains the instructions from the CPU s instruction set. It s in binary. 4
Machine Language Program in hexadecimal for easier reading FYI: Hexadecimal is base 16. Hexadecimal digits: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F 1 hexadecimal digit = 4 binary digits Decimal Binary Hexadecimal 0 0000 0 6 0110 6 10 1010 A 15 1111 F 5
Advantages of First Gen. Software programs execute (run) relatively quickly Software programs are relatively small in size (Insignificant advantages today) Disadvantages of First Gen. Difficult to write, very detailed and takes a long time Difficult to read Difficult to debug debug - the process to find mistakes (bugs) in a software program FYI: the real work starts after the software is written (debugging, maintenance, upgrading) 6
Second Generation Languages (Assembly Language) Assembly Language - The English-like instructions which are equivalent to the CPU s instruction set Source Code - The actual instructions written by a programmer Assembler - Software that converts assembly language to machine code. 7
Assembly Language Program 8
Question: Which of these two files (source code file or machine code file) will the user need to run this software program? Advantages of Second Gen. Easier to read than first gen. Easier to write than first gen. Easier to debug than first gen. Disadvantages of Second Gen. Still very difficult to write programs (building blocks still too small) 9
Third Generation Languages (High level languages) Languages which are somewhere between machine language and the human language. Compiler - Software which translates source code instructions of a particular language into machine code 10
Software 11
Fortran (Formula Translation) - 1950's Language to allow scientists and engineers to program computers. Created at IBM in a committee led by John Backus. COBOL (Common Business Oriented Language) Language primarily designed for US government and defense contractors to program business applications on the computer. Grace Hopper was one of the developers of COBOL (April 1960) The most widely used language 60 s and 70 s BASIC (Beginner's All-purpose Symbolic Code) - John G. Kemeny and Thomas E. Kurtz at Dartmouth College in 1963 Designed for quick and easy programming by students and beginners. 12
Structured programming - Programming technique used to make programming more productive and easier to write. Stresses simplistic, modular programs. Pascal (named after Blaise Pascal, 17th century French mathematician) - 1970's A toy language to teach proper structured programming by Niklaus Wirth. ADA (named after Ada Lovelace - the world s first programmer Charles Babbage Mechanical Computer 19 th century) A Pascal -descended language, designed by Jean Ichbiah's team at Cii Honeywell Bull in 1979 13
C (successor to BCPL or "B") - 1970's A programming language designed by Dennis Ritchie at AT&T Bell Labs ca. 1972 (later Brian Kernighan K&R C later ANSI C) Popular programming language on computers from microcomputers to super computers. Faster and more efficient language. Very powerful language. Since 1980, the most widely used language in the world. (associated with UNIX 1969 by Ken Thompson) Source code example of a C Program: #include <stdio.h> main(){ printf("hello World!"); } C++ (pronounced "C plus plus") - 1986 by Bjorn Stroustroup at AT&T Bell Labs. Object oriented language which is compatible with C. 14
Advantages Easier to read, write and debug Faster creation (or development) of programs Disadvantages Still not a tool for the average user to create software programs* Requires very good knowledge of programming and of the language* * may not be a disadvantage! 15
Java Created by James Gosling at Sun Microsystems Originally created for embedded devices Natural application to the internet Allows you to write one piece of software that will run on any computer Java source code is compiled to java bytecode The bytecode is a program designed to run on a java computer Any computer can simulate a java computer with a program known as the java virtual machine (JVM) Why is this a threat to Microsoft/Intel? A java (bytecode) program JVM PC/ Windows JVM Macintosh JVM any computer 16
Fourth Generation Language Languages which are more like natural human languages uses English phrases common with data base languages search for name equals hodges and state equals ca Examples Access Oracle Informix SQL 17
Sample SQL 18
Advantages Average users can quickly learn to query the database Average users can easily learn how to write programs Programs are written faster Disadvantages Can not write sophisticated programs like word processors, graphics, etc. Mostly for data base applications.. 19
It s safely passed, but still interesting to talk about dept.: Year 2000 NOT a bug! Design decision which affected some programs. 20
The Year 2000 What is the big deal? Older computer systems limited RAM memory limited disk storage slower processors (CPUs) The YEAR was stored using two bytes instead of four bytes, in order to save bytes in RAM and storage 67 instead of 1967 21
Example: 500,000 records Saves 1 million bytes 500,000 x 4 bytes (19xx) - 2 million bytes 500,000 x 2 bytes (xx) - 1 million bytes less storage on disk less RAM memory needed faster processing 22
Problem The year 2000 is 00 or looked at by the computers as the year 1900 Will cause miscalculations for everything from pension funds to horoscopes. Most of these programs were written in COBOL = Need for COBOL programmers! 23