Eckel criticism

C

corky

I have been reading Thinking in Java for a couple of weeks and I think Bruce
mucked up the clarity of examples with the "simpletest" library. He has this
goofy monitor object in his examples. Perhaps I will like it later...
 
S

Stefan Ram

corky said:
I have been reading Thinking in Java for a couple of weeks and
I think Bruce mucked up the clarity of examples with the
"simpletest" library. He has this goofy monitor object in his
examples. Perhaps I will like it later...

You like Eckel criticism? »Alright now, let's go«¹
(1: Quoted from »Ballroom Blitz« by Michael Chapman and Nicky Chinn.)

Recently someone claimed that "Thinking in Java 3",
contained this sentence:

|If you're defining an anonymous inner class and want to use an
|object that's defined outside the anonymous inner class, the
|compiler requires that the argument reference be final, like
|the argument to dest().

Here, Eckel writes:

»object that's defined«.

Objects, however, are not "defined", they are /created/ at
run-time. Names of reference variables are being /declared/
in the source text, not "defined".

http://java.sun.com/docs/books/jls/third_edition/html/statements.html#5920

Then, he continues to write

»argument reference be final«.

This might intend to say that a reference parameter was
declared with "final". "final" is not an attribute of a,
/reference/, but of a variable.

However, this is not about /arguments/ (the reference
arguments do not have to be declared "final" here), but
about /parameters/. The distinction between these two
Java terms seems to be unknown to Eckel.

parameter:

http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.8.7

arguments:

http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.12

He also writes:

»the compiler requires«.

It might be the case that the compiler of Mr. Eckel indeed
requires this, but he should teach a language instead of an
implementation, so it might be preferable to write
"the language specification requires«.

Also, anonymous inner classes are not being /defined/ in
Java, as Eckel writes at the beginning of the quotation, but
they are being /declared/.

Moreover, "anonymous" is an unnecessary restriction, because
the assertion is valid for /all/ inner classes. Someone
learning by this sentence thus needs to learn anew at another
time that this is also valid for non-anonymous inner classes,
or he might believe erroneously for an indetermined amount of
time, that it is only valid for anonymous inner classes.

Is there a way to improve the sentence? One attempt by me:

A parameter to be used within an inner class of its method
needs to be declared »final«.

Even the Java Language Specification itself is easier to
read than Eckel (and of course, much more correct):

Any local variable, formal method parameter or exception
handler parameter used but not declared in an inner class
must be declared final.

http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.3

All the reported faults have been found by me within a single
sentence chosen at random (I did not read the book, but
discovered the sentence in another posting, claiming to quote
this sentence from "Thinking in Java".) If one extrapolates this
error quotient to the whole TIJ, it gives a horrid impression.

Some books might sell chiefly because the buyer wants to
express agreement with their title. When one is learning a
foreign language one does not want to think everything in
English first and then painfully translate it word-by-word.
So one might choose "Thinking in Java" instead of a
garden-variety "Introduction to Java", because one longs for
the promise given by its title, not suspecting that the author
Eckel himself might be far from "thinking in Java".
 
M

Mark Space

corky said:
I have been reading Thinking in Java for a couple of weeks and I think Bruce
mucked up the clarity of examples with the "simpletest" library. He has this
goofy monitor object in his examples. Perhaps I will like it later...

That's pretty much my impression of anything I've read by Mr. Eckel:
goofy.

For Java, I prefer _Learning Java_ by O'Reilly and the Javapassion
website (run by a Sun researcher who gives free on-line courses in
various aspects of Java and Java EE).

<http://www.javapassion.com/javaintro/>
 
C

corky

Mark Space said:
That's pretty much my impression of anything I've read by Mr. Eckel:
goofy.

For Java, I prefer _Learning Java_ by O'Reilly and the Javapassion website
(run by a Sun researcher who gives free on-line courses in various aspects
of Java and Java EE).

<http://www.javapassion.com/javaintro/>

Thanks, I am really suffering with the books I have found so far. I will
refer to the O'Reilly for some help. This is a good language, but the
details of OO can become painful on a beginner. Either the books are too
froofy like Eckel or too lightweight(lets make an applet with dialogue
boxes). I just want the language in plain english for a noob.
 
M

Mark Space

corky said:
Thanks, I am really suffering with the books I have found so far. I will
refer to the O'Reilly for some help. This is a good language, but the
details of OO can become painful on a beginner. Either the books are too
froofy like Eckel or too lightweight(lets make an applet with dialogue
boxes). I just want the language in plain english for a noob.

While waiting for more books to arrive, you could go through the lessons
at the link I gave you. They are designed to be self-paced. The first
ones are pretty basic but they'll get you started with the Netbeans IDE
(a good IDE, imho) and also make sure you aren't missing any of the
fundamentals.

Also, the online Java tutorial that Sun provides is a decent place to
start, although I've found it to be a little less tutorial and a little
more reference.

Sun's Java tutorial:

http://java.sun.com/docs/books/tutorial/

Eventually, you'll need to refer to the on-line Java doc for the parts
of the API not covered in tutorials. Google for "java classname se 6"
will almost always get you the the Java doc for the class named classname.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top