Conservatively Radical Java
in CS1
Stuart Reges
University of Arizona
reges@cs.arizona.edu
CS1 in Pascal circa 1990
Topic |
Weeks |
simple data, expressions,
variables, assignment |
1.0 |
console read/write |
0.5 |
if/else and type boolean |
1.5 |
for loops |
1.0 |
while loops |
1.5 |
procedures, var/value
parameters |
2.0 |
functions |
0.5 |
file I/O |
1.0 |
arrays, type declarations |
2.0 |
records, combinations of
records and arrays |
1.5 |
sorting & searching |
1.0 |
miscellaneous (enumerated
types, formatted output, constants, testing, debugging etc) |
1.5 |
total |
15.0 |
CS1 in Java circa 2000
Topic |
Weeks |
simple data, expressions,
variables, assignment |
1.0 |
console read/write |
1.0 |
if/else and type boolean |
1.5 |
for loops |
0.5 |
while loops |
1.5 |
methods, value parameters,
return values |
1.5 |
file I/O |
0.5 |
arrays |
2.0 |
using classes |
0.5 |
defining classes |
2.5 |
sorting & searching |
0.5 |
miscellaneous (applets,
graphics, inheritance, abstract classes, interfaces) |
2.0 |
total |
15.0 |
First Class
Definition Example
from a Popular Java CS1 Book
class Data
{
Data(int a)
void printA()
void printB()
private int a;
}
First Class
Definition Example
from a Popular Java CS1 Book
public class Data
{
private double a;
public double convertA()
public void readA()
public void displayAll()
}
First Class
Definition Example
from a Popular Java CS1 Book
public class A
{
public void readAll()
public void writeAll()
public int changeB()
public string a;
public int b;
public double c;
}
First Class
Definition Example
from a Popular Java CS1 Book
class Data
{
public Data(String a)
public void displayA()
public void display(String a)
private String a;
}
First Class
Definition Example
from a Popular Java CS1 Book
public class Data
{
protected a, b;
public Data(double a, double b)
public void setData(double a, double b)
public double getA()
public double getB()
public String toString()
}
The
Alternative?
students still focus on traditional CS1 topics like
conditionals, loops, arrays, etc (conservative)
but instead of writing complete programs, they
implement some portion of a larger program that is a modern, well-designed,
GUI, OOP application (radical)
The
Results?
students are happier
but don’t seem to learn much more
but maybe that’s just not obvious
lots of work for the instructor or someone else to
create the programs the students are to complete
For More
Information
http://www.cs.arizona.edu/people/reges
special user called
“teacher”
ask Stuart for the secret
password