Presentation is loading. Please wait.

Presentation is loading. Please wait.

LCC 6310 Computation as an Expressive Medium

Similar presentations


Presentation on theme: "LCC 6310 Computation as an Expressive Medium"— Presentation transcript:

1 LCC 6310 Computation as an Expressive Medium
Lecture 2

2 Administrivia Status of books? Enrollment Lab times

3 Overview Discuss readings Java programming with BlueJ
Two classic examples of textual interaction Eliza Adventure

4 What do you think of this?
“Which means that those computer scientists who invented these technologies … are the important artists of our time, maybe the only artists who are truly important and who will be remembered from this historical period.” Lev Manovich

5 NMR Introductions Relationship between art and CS
Should new media artists program? Why? What about collaboration? Computation as a medium

6 Personal Dynamic Media – Kay & Goldberg
The vision of the contemporary laptop computer “If the ‘medium is the message’, then the message of low- bandwidth timesharing is ‘blah.’ But, moves beyond contemporary environments in supporting end-user tool creation “The total range of possible users is so great that any attempt to specifically anticipate their needs in the design of the Dynabook would end in a disastrous feature- laden hodgepodge which would not be suitable for anyone.”

7 Introduction to BlueJ Graphical environment for creating and editing classes Classes are associated with projects, where a project is a collection of related classes Each project is in it’s own directory Automatically creates templates for new classes Demo

8 Comments Comments are non-program text you put in the file to describe to others (and yourself) what you’re doing Important for being able to look back at your code and understand it Single-line comments begin with // Multi-line comments begin with /* and end with */

9 Editing and compiling classes
Demo with Greeter class Greeter { String greeting; public Greeter(String newGreeting) { greeting = newGreeting; } public void greet(String name) { System.out.println(greeting + ", " + name);

10 Creating objects and running methods
BlueJ gives you a Java interpreter Interpreters let you evaluate expressions on the fly You can use the interpreter to create instances (objects) from classes You can look at the fields and methods of an object You can even invoke methods on an object (without a public static void main) Demo

11 Creating a second class
Demo with Driver class Driver { public static void main(String args[]) { Greeter g1 = new Greeter("Hello"); Greeter g2; g2 = new Greeter("Good morning"); g1.greet("Bob"); g2.greet("Mary"); g1.greet("Sam"); g2.greet("Joan"); }

12 Debugger BlueJ provides a graphical debugger
Debuggers help you to see what your code is doing Debugger concepts Breaking Stepping Continuing Call stack Variables Demo

13 Miscellaneous BlueJ problems
BlueJ has some bugs (gasp) Creating bug-free software is virtually impossible Some problems to look for Selecting the top of the call stack Resetting the virtual machine

14 Types A type is a restriction on the value of a field or variable
The compiler checks types for consistency A truth of debugging: Errors are much harder to find when you run your program (runtime), than when you compile your program (compile time) Types allow the compiler to catch errors before you run your program Classes are types!!!! Demo

15 Things that have types Fields Variables
Arguments (a special kind of variable) Return values

16 Java API documents There are a lot of classes in the Java class library The description of each class includes links to related classes Parents Children Return values Arguments Related classes

17 Class System The System class provides access to console IO as well as several utility methods out is a field of type PrintStream Use it to print to the console in is a field of type InputStream Use it to read from the console

18 Class PrintStream Makes it easy to create output
Generic – I could potentially use a PrintStream to output to the console, the network, a file, … System.out is an instantiated PrintStream (an object created from PrintStream) that is bound to (writes to) the console

19 The mysterious System.out.println
System is a class Normally we can only refer to fields or methods on objects, but sometimes we refer specifically to the class A period - . – provides field access A period - . – also provides method access So… System.out refers to the static field out on the class System out.println(…) refers to the method println on the PrintStream object held in the field out

20 Class String The innocent String is actually a class!
Any String object provides a lot of methods and has structure Demo

21 Primitive types As a concession to efficiency, there are a few types that aren’t classes You don’t use new You can’t call methods Some primitives int, float, double, long, byte, char, boolean Demo

22 Computation as a medium
Text input and output – fundamental interaction Language The conversational metaphor Ergodics (thanks Espen)

23 Text – persona Take the conversational metaphor literally
The first chatterbot – Eliza Expectation – scripting the interaction

24 Text – place and object Take action with a represented space
Command language Segment experience into places and objects Descriptive language The first adventure game (interactive space) - Adventure


Download ppt "LCC 6310 Computation as an Expressive Medium"

Similar presentations


Ads by Google