what's the story about acm library

H

Henry Huang

Hi, everyone. I'm trying to learn Java programming recently and found a course from stanford university on itunes u. The course uses acm library and seems its built in to their version of eclipse. The course was recorded backin 2007, I java changed a lot over this period and I'm just curious is this a obsolete thing or some kind of tradition in standford computer science or there's some kind of benefit in this library? is there a equivalent in the current standard java library? Thanks
 
S

Stefan Ram

Henry Huang said:
Hi, everyone. I'm trying to learn Java programming

Let's start with a look at this BASIC program:

10 INPUT "X = "; A
20 PRINT "The square root is"; SQRT(A);"."

. This program will ensure the user enters a
correct number:

RUN
X = ? rgiehi
?REDO FROM START
X = ? 25
The square root is 5.

You also can plot like this in BASIC:

10 COLOR 100,100,100 : POINT 50,75

and will see a point of color 100, 100, 100 at position
50,75.

Now what is the shortest Java program to accomplish these
two tasks?

Parsing user input or plotting is way more complicated in
Java than in BASIC.

Now, certain teachers still want to teach programming with
Java as they once did with BASIC. But Java is different than
BASIC. So, they often choose to supply a library that
emulates such behavior in Java: reading values of a certain
type from the user without having to do the type-checking
oneself, plotting pixels without having to learn about
»paintComponent«.

I also teach Java, but refrain from adding any custom
libraries. So, I postpone the topics of reading input from
the user or plotting points and start by teaching other
material until students have learned enough to be able to do
this in Java SE. After all, I do not want that my students
learn my custom library when they have their first contact
with Java, but they should learn Java and the Java SE
library. And there already is enough to explore in the Java
SE library without the need to add a custom library in an
attempt to »retrofit« Java so as to conform to some
BASIC-like idea of programming.
 
S

Stefan Ram

Henry Huang said:
course from stanford university on itunes u.

Some weeks ago, I also posted these comments here:

Message-ID: <[email protected]>

I decided to watch lecture videos from the Stanford
University about »programming methodology«, which actually
teach Java.

I was somewhat surprised that the lectures of the renowned
Stanford university do not have such a high overall
quality at all.

For example, the lecturer (http://en.wikipedia.org/wiki/Meh
r*n_S*h*mi, where *=a) wrote on the blackboard

»off by one error«,

but what he meant clearly was an

»off-by-one error«.

. Regarding Java, he explained the import statement as if
this was required to make a class »available«, while it does
nothing more than to provide a simple name for a class
instead of its fully qualified name. (To make a class
available, the »-cp« option of java(c) is used.)

He also explained that Java programs were linked by creating
a JAR archive for them. (While in fact the creation of a JAR
archive is not necessary and the linking [that is, replacing
symbolic references by their referents] takes place when the
classes are loaded by the JVM, independently of whether they
come from class files or JAR files.)

But I have watched only the first lectures so far.

Message-ID: <[email protected]>

I just watched another lecture and noticed the following:

He said something to the effect that the type »int« was there
to store an int value. I would say that an int /variable/ is
there to store a value, while the /type/ int can also be the
type of an expression (like »2«) that is not necessarily
stored anywhere at run-time.

He said that a variable had a name. This is not always true
in Java (he referred to Java, since he is exclusively using
Java). In Java there also are anonymous variables, like the
variables of an array.

He said that the remainder operator »%« can only be applied
to integers. This also is not true in Java IIRC.

Message-ID: <[email protected]>

Sven Köhler said:
To be honest, the notion "anonymous vairable" is really not necessary to
understand how arrays work - and to be honest, your posting is the first
time I read that term.

The JLS, while being technical, actually sometimes is quite
easy to read:

One can open the table of contents, spot chapter »10. Arrays«,
and immediately read near the very beginning of that chapter:

»An array object contains a number of variables.« (JLS7 10)

»The variables contained in an array have no names« (JLS7 10)

The expression »new int[ 3 ]« has as its value an array of three
variables, but neither this object nor those variables have
a name.
I know that you are particular precise about thing, but I'm pretty sure,
he will teach that arrays have elements.

»These variables are called the components of the array.« (JLS7 10)

Message-ID: <[email protected]>

Well, I hope you are not annoyed yet. But I just spotted the
first major software-methodology error! He explained the
scope of a variable as the lifetime of the variable. It was
even displayed as text: »Scope: lifetime of variable«. This
really hurts!

For those of you, who have not yet learned the distinction
(untested code ahead), after:

class Object
{ /* begin of scope of i */
final int i; public Object( final int i ){ this.i = i; }
/* end of scope of i */ }

and then in »main«:

{ { final Object o = new Object( 4 );
java.lang.System.out.println( o ); }

{ final Object o = new Object( 7 );
java.lang.System.out.println( o ); }}

, after execution, there were two instances of »i« (with
values 4 and 7) that had the same scope (as identifiers),
but different lifetimes (as variables), and two instances of
»o« which indeed have different scopes (as identifiers).

A scope is a region of the source text. Identifiers
have a scope.

A lifetime is a period of time during the execution
of a program. Variables and objects have lifetimes.

This has no special relation with Java, this is
software engineering (or »programming methodology«).
 
J

Jeff Higgins

Hi, everyone. I'm trying to learn Java programming recently and found a course from stanford university on itunes u. The course uses acm library and seems its built in to their version of eclipse. The course was recorded back in 2007, I java changed a lot over this period and I'm just curious is this a obsolete thing or some kind of tradition in standford computer science or there's some kind of benefit in this library? is there a equivalent in the current standard java library? Thanks
The latest page for the JTF that I can find:
<http://www-cs-faculty.stanford.edu/~eroberts/jtf/>

You don't mention a title or give a link to the course you mention.

From what I can find all of the courses that use this library advertise
"Learn Programming" rather than "Learn Java".
 
J

Jeff Higgins

I also teach Java, but refrain from adding any custom
libraries. So, I postpone the topics of reading input from
the user or plotting points and start by teaching other
material until students have learned enough to be able to do
this in Java SE. After all, I do not want that my students
learn my custom library when they have their first contact
with Java, but they should learn Java and the Java SE
library. And there already is enough to explore in the Java
SE library without the need to add a custom library in an
attempt to »retrofit« Java so as to conform to some
BASIC-like idea of programming.
I'm curious.
What prerequisites are required for your most introductory Java course?
And what would I learn on the first day?
 
J

Jeff Higgins

I'm curious.
What prerequisites are required for your most introductory Java course?
And what would I learn on the first day?
Ah, now I see. I hadn't thought to look for your web pages.
So, one could enter your course knowing how to start their
workstation and operate a text editor and perhaps a browser.
I'm impressed by how you approach and overcome the hurdle
getting a first Java program running.
 
S

Stefan Ram

Jeff Higgins said:
I'm curious.
What prerequisites are required for your most introductory Java course?

Some familiarity with operating a computer (like knowing
where to find characters on the keybord, to use a web
browser or to edit a text file), but no programming
knowledge or experience at all.
And what would I learn on the first day?

The first day usually has 3 hours. It will cover:

- the first exercise is: Try to turn on both the computer and
the monitor! (It usually takes 2 minutes until the students
find all the power switches, which manufacturers seem to try
to hide as best as they can!)

- general concepts of programming

http://www.purl.org/stefan_ram/pub/grundbegriffe-programmierung

(some remarks regarding these links to German-language
lessons follow below).

- general concepts of Java programming

http://www.purl.org/stefan_ram/pub/java_grundbegriffe

- A first Java program (this includes exercises in compiling
and running it with the JDK and a text editor of the
student's choice [usually the standard text editor of the
operating system is used], and also in renaming the class)

http://www.purl.org/stefan_ram/pub/java-hallo-welt

- the »value-expression frame«

http://www.purl.org/stefan_ram/pub/java_ausgaberahmen_de

. This is a boilerplate Java program with a gap, where a
value expression can be inserted.

public class Main
{ public static void main( final java.lang.String[] args )
{ java.lang.System.out.println( ... ); }}

The details of the boilerplate are not explained yet
(well, they were explained in the preceding lesson, but
only cursory).

- literals

http://www.purl.org/stefan_ram/pub/java_gleitkommazahlen

This lesson shows literals of the types »java.lang.String«,
»int«, and »double« (the text of the URI is misleading).
(Details [like »\"« for »"« or »2E2« for »200«] are
intentionally omitted.)

And this is what you will learn on this first day.

~~

I have announced a new class for this autumn that will be
held in English and will take place in Berlin (Germany)
(2013-11-23, 2013-11-24, and 2013-11-30). If this will have
enough registrations, then it will actually take place and
will be my first-ever class given in English. For this
class, I intend to translate my teaching notes into English.

But since this translation is not yet done, maybe you can
have a look at my German-language class notes. Maybe you
do not know German, but you can read the Java source code
contained in the pages. The URI is

http://www.purl.org/stefan_ram/pub/java_de

. (15 % of all visitors from the Usenet get a »403 access
denied«. If that should happen to you, please try another
browser or let me know, so that I can loosen the firewall
rules for 48 hours for at least this page and the first
three lessons.)

The course page links to all the individual lessons. The
first 19 lessons are more written out in full, while some of
the later lessons are still more in note form.

The pace of the course is very slow due to an adaption to
the learning speed of my average adult student, who also
does not have time for any out-of-class exercises or so
(I am giving classes at an adult evening school). A whole
lesson is devoted to the operator »+«, then the next lesson
treats »-« and so on. This course is for absolute beginners
with no programming experience whatsoever.
 
L

Lew

Stefan said:
...
The course page links to all the individual lessons. The
first 19 lessons are more written out in full, while some of
the later lessons are still more in note form.

The pace of the course is very slow due to an adaption to
the learning speed of my average adult student, who also
does not have time for any out-of-class exercises or so
(I am giving classes at an adult evening school). A whole
lesson is devoted to the operator �+�, then the next lesson
treats �-� and so on. This course is for absolute beginners
with no programming experience whatsoever.

Kudos.

I just gave a brief overlook of your course material (courtesy of
Google Translate) and the pedagogy and detail are excellent.

You say the pace is slow, but actually it seems entirely dependent on the
student. The level of detail is fractal, and that admits of a slow pace
should the student require it. A student with more context, say one who
did learn BASIC and did well with it, could move very quickly indeed through
the familiar material.

I'd say the course is a tour de force.
 
J

John B. Matthews

Henry Huang said:
Hi, everyone. I'm trying to learn Java programming recently and found
a course from stanford university on itunes u. The course uses acm
library and seems its built in to their version of eclipse. The
course was recorded back in 2007, I java changed a lot over this
period and I'm just curious is this a obsolete thing or some kind of
tradition in standford computer science or there's some kind of
benefit in this library? is there a equivalent in the current
standard java library? Thanks

See also <http://stackoverflow.com/a/12130829/230513>
 
H

Henry Huang

Thank you all. The course is actually CS106A, an introductory course to programming so I guess this makes a lot of sense.
I lean toward using the standard library but I think why I can do this without too much difficulty is because I'm not completely new to programming. So I think I'm not in a good place to put critics on the course as this is avery large class targets students with all kind of majors and general public. The lecturer is actually very entertaining as well.
Anyways, good to know there's an ACM library exist. And I believe there's apurpose for the existence of such a library that seems so many people are using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top