L2cs2110fa08-6up - Announcements ! Assignment 1 has been...

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

View Full Document Right Arrow Icon
Java Review Lecture 2 CS2110 Fall 2008 Announcements ! Assignment 1 has been posted " Due Wednesday, September 10, 11:59pm " Materials available in CMS ! Check that you are in CMS " Report any problems to your Section TA (email is fine) ! It’s really a good idea to start on A1 and check CMS this week (well before the assignment is due) ! Available help " Consulting will start very soon—watch for announcements " Instructor & TA office hours are in effect ! Check daily for announcements http://courses.cs.cornell.edu/cs2110 2 More Announcements ! Sections start this week " Section material will be useful for A1 ! Dexter out of the country 9/3 - 9/7 (Nottingham, England) " 9/4 guest lecturer: Juan Altmeyer Pizzorno 3 Today — A Smorgasbord ! A brief (biased) history of programming languages ! Review of some Java/OOP concepts ! Java tips, trick, and pitfalls ! Debugging and experimentation 4 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 ! Example code 0110 0001 0000 0110 Add Reg1 6 ! An idea for improvement " Use words instead of numbers " Result: Assembly Language 5 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) ! 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 6
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 ! The whole concept was initially controversial " FORTRAN (mathematical FOR mula TRAN slating system) was designed with efficiency very much in mind 7 FORTRAN ! Initial version developed in 1957 by IBM ! 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 8 ALGOL ! ALGOL = ALGO rithmic L anguage ! Developed by an international committee ! First version in 1958 (not widely used) ! Second version in 1960 (widely used) ! 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 9 COBOL !
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 / 6

L2cs2110fa08-6up - Announcements ! Assignment 1 has been...

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