02-JavaReview

02-JavaReview - Outline CS/ENGRD 2110 Object-Oriented...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1/27/2011 1 CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2010 Thorsten Joachims Lecture 2: Java Review Outline A brief (biased) history of programming languages Review of some Java/OOP concepts Java tips, trick, and pitfalls Debugging and experimentation 2 Machine Language Used with the earliest electronic computers (1940s) Machines use vacuum tubes instead of transistors Programs are entered by setting switches or reading punch cards All instructions are numbers 3 Example code 0110 0001 0000 0110 add reg1 6 An idea for improvement Use words instead of numbers Result: Assembly Language Assembly Language Idea: Use a program (an assembler ) to convert assembly language into machine code Early assemblers were some of the most complicated code of the time (1950s) 4 Example code ADD R1 6 MOV R1 COST SET R1 0 JMP TOP Idea for improvement Let’s make it easier for humans by designing a high-level computer language Result: high-level languages High-Level Language Idea: Use a program (a compiler or an interpreter ) to convert high-level code into machine code Pro Easier for humans to write, read, and maintain code Con The resulting program will never be as efficient as good assembly-code Waste of memory Waste of time 5 The whole concept was initially controversial FORTRAN (mathematical FORmula TRANslating system) was designed with efficiency very much in mind FORTRAN Initial version developed in 1957 by IBM 6 Example code C SUM OF SQUARES ISUM = 0 DO 100 I=1,10 ISUM = ISUM + I*I 100 CONTINUE FORTRAN introduced many high-level language constructs still in use today Variables & assignment Loops Conditionals Subroutines Comments
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1/27/2011 2 ALGOL ALGOL = ALGO rithmic L anguage Developed by an international committee First version in 1958 (not widely used) Second version in 1960 (widely used) 7 Sample code comment Sum of squares begin integer i, sum; for i:=1 until 10 do sum := sum + i*i; end ALGOL 60 included recursion Pro: easier to design clear, succinct algorithms Con: too hard to implement; too inefficient COBOL COBOL = CO mmon B usiness O riented L anguage Developed by the US government (about 1960) Design was greatly influenced by Grace Hopper Goal: Programs should look like English Idea was that anyone should be able to read and understand a COBOL program 8 COBOL included the idea of records (a single data structure with multiple fields , each field holding a value) Simula & Smalltalk These languages introduced and popularized Object Oriented Programming (OOP) Simula was developed in Norway as a language for simulation in the 60s Smalltalk was developed at Xerox PARC in the 70s These languages included Classes Objects Subclasses & Inheritance 9 Java 1995 Java includes Assignment statements, loops, conditionals from FORTRAN (but syntax from C ) Recursion from ALGOL Fields from COBOL OOP from Simula & Smalltalk
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

02-JavaReview - Outline CS/ENGRD 2110 Object-Oriented...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online