Cs2220: Engineering Software Class 2: Introduction Java Fall 2010 University of Virginia David Evans.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

A Programmer's Introduction to Java - from a S/370 user (c) IDMS/SQL News
Introduction Class Notes How to Program in C++ By : dettle & dettle READING MATERIAL
1 Java Basics. 2 Compiling A “compiler” is a program that translates from one language to another Typically from easy-to-read to fast-to-run e.g. from.
Introduction to Java Kiyeol Ryu Java Programming Language.
Excerpts from Introduction to Java Programming, 4E Author: Y. Daniel Liang (Copyright by Prentice Hall)
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 9: Low-Level Programming
Introduction to Java.
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Class 24: Programming with Objects University of Virginia cs1120 David Evans.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 28: Implementing Interpreters.
1 Are you ready?. 2 Professor: Vladimir Misic Office : Phone: Office Hours : Mon, Tue; 2:00pm – 4:00pm Website :
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Getting Started What is Java? A programming language –Fully buzzword-compliant: A simple, object oriented, distributed, interpreted, robust, secure,
BASIC JAVA PROGRAMMING TUTORIAL. History  James Gosling and Sun Microsystems  Oak  Java, May 20, 1995, Sun World  Hot Java –The first Java-enabled.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
 Define a problem  Prepare sequence of instructions for the computer to execute  Verify that the program works as expected.
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Chapter 1 Coding Introduction.
Introduction to Java Programming with JBuilder 4
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Introduction COMP104: Fundamentals and Methodology.
Java Workshop for Teachers May 6, 2005 A Brief Look at the Java Programming Language.
Programming Languages
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Java Beserkers Group 4. Start of Java Development began on June of 1991 by a group of computer scientist at the Sun Mircrosystems Company Development.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Class 37: Computability in Theory and Practice cs1120 Fall 2011 David Evans 21 November 2011 cs1120 Fall 2011 David Evans 21 November 2011.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
Class 14: Object-Oriented Programming Fall 2010 University of Virginia David Evans cs2220: Engineering Software.
Chapter 1 Section 1.1 Introduction to Java Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Introduction To JAVA By Ihtesham Ul Haq. Course Objectives Upon completing the course, you will understand Upon completing the course, you will understand.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Announcements Due dates extended: Project 1B—Wednesday by 10pm rule Thursday by 10pm Lab 5—Friday by 10pm Next week Labs 6/7—Tuesday by 10pm 11/19/2015D.A.
Java and its Evolution. Contents Java Introduction Java Features How Java Differs from other OO languages Java and the World Wide Web Java Environment.
Lecture 1. Introduction to Programming and Java MIT- AITI 2003.
Cs205: engineering software university of virginia fall 2006 Introducing Java David Evans Don’t forget to your registration.
Introduction to Programming. The Programming Process Create/Edit Program Compile Program Execute Program Compile Errors?Run-Time Errors? Source Program.
What is Java? Object Oriented Programming Language Sun Microsystems “Write Once, Run Everywhere” Bytecode and Virtual Machine Java Platform (Java VM and.
Introduction Mehdi Einali Advanced Programming in Java 1.
CS 106 Introduction to Computer Science I 01 / 22 / 2007 Instructor: Michael Eckmann.
introductory lecture on java programming
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
WHY ARE WE HERE? Nick Derrickson BA371, Winter 2016.
Cs2220: Engineering Software Class 13: Behavioral Subtyping Fall 2010 University of Virginia David Evans.
Cs205: engineering software university of virginia fall 2006 David Evans Object-Oriented Programming.
Computer Programming Week 1: The Basics of CP 1 st semester 2012 School of Information Technology Website:
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
Programming Language Paradigms ITSK2314 Lecture 3.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Chapter 1 Coding Introduction.
Chapter No. : 1 Introduction to Java.
CS216: Program and Data Representation
An Overview of Java.
Getting Started ARCS Lab..
Chapter 1 Coding Introduction.
Advanced Programming Fall 2017.
Concurring Concurrently
Security in Java Real or Decaf? cs205: engineering software
(Computer fundamental Lab)
CSC 142 Introduction to Java [Reading: chapters 1 & 2]
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

cs2220: Engineering Software Class 2: Introduction Java Fall 2010 University of Virginia David Evans

Course Announcements Assistant Teacher: Robbie Hott Help for PS1: Friday, 2:30-3:30pm (Thornton Stacks) Office Hours Extended Thursday to be 11am-12:30pm Extended Monday to be 1:30-3:30pm Added Wednesday, noon-1pm My door is (almost) always open – feel free to stop by outside of office hours

Survey Responses Java Experience See the web post for my answers to your questions.

Survey Responses We will not have assignments involving Twitter or Instant Messaging! but…if you don’t like the assigned project, you can always propose your own.

Late Policy

Why Java?

Why learn a new language?

Money? According to

New Ways of Thinking

J S Bach, “Coffee Cantata”, BWV 211 (1732) “Jamais Jamais Jamais” from Harmonice Musices Odhecaton A. (1501)

Modern Music Notation Roman Haubenstock-Ramati, Concerto a Tre John Cage, Fontana Mix

Thought and Action Languages change the way we think – BASIC: think about GOTO – Scheme: think about procedures – Algol, Pascal: think about assignments, control blocks – Java: think about types, objects Languages provide abstractions of machine resources – Hide dangerous/confusing details: memory locations, instruction opcodes, number representations, calling conventions, etc. – Hiding more increases simplicity, but limits expressiveness

Why so many programming languages?

Fundamental Differences All equivalently powerful! – Universal languages: all capable of simulating each other Fundamental differences – Expressiveness: how easy it is to describe a computation – “Truthiness”: likelihood that a program means what a programmer things it means – Safeness: impact of programmer mistakes There is a fundamental conflict between expressiveness and truthiness/safeness

Programming Language Design Space Expressiveness “Truthiness” Scheme Python Java C++ C low high Spec# Ada strict typing, static BASIC more mistake prone less mistake prone print ("Hello!") (display “Hello!”)

Shortest HelloWorld in Java public class HelloWorld { public static void main(String[] args) { System.out.println ("Hello!"); } Actual computation Structural punctuation object class method header class header

Pragmatic Differences Performance of available compilers, interpreters Tools available Libraries Portability Availability/cost of programmers

What is Java? A.Island in Indonesia known for coffee and volcanoes B.A Programming Language (Java  ) C.A Portable Low-Level Language (JVML) D.A Platform (JavaVM) E.A (semi-)successful marketing strategy – JavaScript is not related to Java or Java  F.All of the above

Programming Languages Phylogeny Fortran (1954), IBM (Backus) Algol (1958) Scheme (1975) CPL (1963), U Cambridge Combined Programming Language BCPL (1967), MIT Basic Combined Programming Language B (1969), Bell Labs C (1970), Bell Labs C++ (1983), Bell Labs Java (1995), James Gossling, Sun (Oracle) Objective-C (1986) Simula (1967) Python (1990), Guido van Rossum ABC (~1980) BASIC (1963) Smalltalk (1971), PARC LISP (1957)

Java History 1991: “Stealth Project” formed at Sun – Computing for consumer electronics market James Gosling tasked with selecting a programming language for project – Started with C++, but found inadequate In later classes, we’ll talk about why – Developed extensions and subtractions that led to new language “Oak” 1993: Web arrives 1995: Sun releases HotJava browser and Java PL, Netscape incorporated into browser

Buzzword Description “A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language.” [Sun95] As the course proceeds, we will discuss how well it satisfies these “buzzwords”. You should especially be able to answer how well it satisfies each of the blue ones in your final interview.

Non-Buzzword Description Java sacrifices expressiveness for “truthiness”: A Java program is ~5x larger than the corresponding Scheme or Python program Java sacrifices performance for safety, “truthiness”, and portability: A Java program is ~3x slower than a comparable C++ program (but 10x faster than the comparable Python program) Caveat: these numbers are “guesses” and gross simplifications. Real numbers depend on the program (and programmer!). C++JavaPython Computer Language Benchmarks Game

Java Programming Language Syntax – Similar to C++ – Designed to be easy for C++ programmers to learn Semantics (what programs mean) – Similar to Scheme – Designed to make it easier to reason about properties of programs

Programming Systems Scheme Interpreter Scheme Program C++ Compiler C++ Program Machine Object Files InterpretedCompiled

Portability If you can implement a Java VM on your machine, then you can run all Java programs Security A VM can limit what programs can do to the real machine Simplicity VM instructions can be simpler than machine instructions Java VM Java Compiler Java Program Java Virtual Machine Class Files Why use a virtual machine?

Summary Languages change the way we think Programming languages must trade-off expressiveness and “truthiness” cs2220 uses a language designed primarily for truthiness because that makes it easier to build dependable, complex, maintainable programs Beginning of class Tuesday: Problem Set 1 Due