Arrays in java

G

glen herrmannsfeldt

(snip)
This seems to assume that there is one thing that can be called
"learning Java".
I don't think of knowing a programming language as a binary property,
but in terms of a continuous range of levels of knowledge.

Seems fair.
One end of the range is "never even heard of it". At the other end of
the range is the sort of knowledge that James Gosling has for Java, or
Bjarne Stroustrup for C++.

Somewhere in between is the point where you can work on a program
and end up with fewer errors than when you started.

For C, when you can post to comp.lang.c without too many people
laughing at your posts.
The highest level of language knowledge I've ever achieved for any
language is that needed to produce a working implementation on a real
computer, which I've only done for K&R C and Fortran 77. That requires
familiarity with the language's defining documents as well as full,
detailed understanding of how it really works. I don't have quite that
level of knowledge for Java.

There are some languages that I know well enough to read, but
not well enough to write.
What does "learning Java" mean in the context of a beginner? I suggest
that a reasonable default is "know the language well enough to write
professional quality code in it".
Putting it in the context of this thread, I would say it includes
knowing that "int[] productIDs = {10,20,30};" is normal code to declare
an array reference and initialize it. I am not sure it includes knowing
which weird arrangements of "[]" placement are permitted for
multi-dimensional arrays.

I suppose if you know one way of writing something that is enough.
You don't need to know all of them to successfully write programs.
I contend that reading the JLS is not necessary for that level of
knowledge of Java. Reading good secondary sources is likely to be more
effective.

After learning enough languages, I do tend to go for the
authoritative source, but that might not be best
for everyone.

(snip)

-- glen
 
L

Lew

Patricia said:
Lew wrote:
...
> - I claimed that the JLS is an essential tool to learning Java,
> along with recommending other useful sources. No one
> has even said that it isn't, much less established that it isn't.

This seems to assume that there is one thing that can be called
"learning Java".

I don't think of knowing a programming language as a binary property,
but in terms of a continuous range of levels of knowledge.

One end of the range is "never even heard of it". At the other end of
the range is the sort of knowledge that James Gosling has for Java, or
Bjarne Stroustrup for C++.

The highest level of language knowledge I've ever achieved for any
language is that needed to produce a working implementation on a real
computer, which I've only done for K&R C and Fortran 77. That requires
familiarity with the language's defining documents as well as full,
detailed understanding of how it really works. I don't have quite that
level of knowledge for Java.

What does "learning Java" mean in the context of a beginner? I suggest
that a reasonable default is "know the language well enough to write
professional quality code in it".

Putting it in the context of this thread, I would say it includes
knowing that "int[] productIDs = {10,20,30};" is normal code to declare
an array reference and initialize it. I am not sure it includes knowing
which weird arrangements of "[]" placement are permitted for
multi-dimensional arrays.

I contend that reading the JLS is not necessary for that level of
knowledge of Java. Reading good secondary sources is likely to be more
effective.

> - I claimed that actively discouraging newbies (or anyone
> else) from studying the JLS is a disservice to their learning
> and professional progress. No one has addressed this point.
>

I strongly disagree. I was already a very experienced programmer in
several languages, and had studied the defining documents for some of
them, when Java was developed, but I can imagine facing
learning Java as a beginning programmer. If, as a beginner, I had
thought that understanding something like JLS section 17.4,
http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4,
were necessary to learn Java, I would have abandoned the attempt in
favor of some language that could be learned using only simpler, more
readable, materials.

I disagree partially with your points, but they are cogent and well supported.

I don't believe a beginner should rely on the JLS to learn the language, as I
have stated many times. I do agree that the JLS can be rather daunting, at first,
and like any other specification is in some places just a bit thick, but as specs
go it really is comparatively clear, and parts are as baldly and simply stated as
anyone could wish.

The problem is that without an awareness of the JLS, one can be misled by
inaccurate or incomplete information from secondary and tertiary sources.
Many of the discussions are prime examples, and the ones where one reference
specific JLS passages, they tend to unequivocally settle issues of Java fact.

To actively discourage newbies from studying the JLS is to limit them. This
is different from simply not recommending the JLS as a beginner's tool.
Even new Java programmers at a minimum need to know that the JLS
exists, and that it is the authority, and that should they really, really wish
final resolution to certain questions, it is found there. They should have
it as a goal to be able to use it.

I started using the JLS very early in my Java career, and it has never
given me cause to regret that choice.

I also assert that it isn't anywhere near as impossible as all the fear-
mongers claim, except in some few parts. Regardless, I respect your
conclusions, even the ones with which I disagree.

Bottom line, I go with something like glen herrmannsfeldt's idea, that
for each Java programmer there comes a time when it makes sense
to use the JLS. The earlier one knows that the JLS option exists, the
more power one has to exercise choice over gaining that next,
minimum level of Java programming capability.
 
L

Lew

Patricia said:
Lew wrote:
...

I feel the same way, but that is irrelevant because of my prior
experience. Was the start of your Java career also the very first time
you had ever attempted to write a computer program?

Some colleges are using Java as the first language for their freshman
computer science students, and teaching it as one of the first courses.
That means there are teenagers trying to learn Java who have no idea
what a formal grammar is, or how it works.


I think the word "minimum" is where we disagree. I think one can become
a very competent Java programmer without having read the JLS.

Fair enough.
 
G

glen herrmannsfeldt

Patricia Shanahan said:
Lew wrote:
...
I feel the same way, but that is irrelevant because of my prior
experience. Was the start of your Java career also the very first time
you had ever attempted to write a computer program?

I learned my first language, Fortran, from the IBM S/360 Fortran IV
reference manual. Then again, I am probably not a typical case.
Some colleges are using Java as the first language for their freshman
computer science students, and teaching it as one of the first courses.
That means there are teenagers trying to learn Java who have no idea
what a formal grammar is, or how it works.

-- glen
 
S

Stefan Ram

Patricia Shanahan said:
That means there are teenagers trying to learn Java who have no idea
what a formal grammar is, or how it works.

In my first Java programming classes for a general audience at
an evening school for adults, I started out to teach EBNF first.
But now I have given up on this, because it confused the people.
Sometimes, EBNF productions were confused with Java source code
and were written into the program! But even if this would not
happen, it costs time to teach EBNF, which is then lacking for
Java in those relatively short-time classes. If I would have to
give classes with more than 100 hours, I might start to teach
EBNF first. But my classes usually have about 18 hours for the
beginner class (plus about 12 - 18 hours for an optional
continuation class, the »advanced course«).
 
M

Martin Gregorie

Lew wrote:
...

I feel the same way, but that is irrelevant because of my prior
experience. Was the start of your Java career also the very first time
you had ever attempted to write a computer program?

Some colleges are using Java as the first language for their freshman
computer science students, and teaching it as one of the first courses.
That means there are teenagers trying to learn Java who have no idea
what a formal grammar is, or how it works.
My first language was Algol 60[*], so of course I rapidly became familiar
with BNF notation, since all Algol 60 manuals included the BNF-defined
syntax as an appendix. Consequently, I more or less expect any language's
syntax to be described fairly formally, preferably by using BNF or at
least the tram-track diagrams that Pascal introduced.

[*] I learned Algol 60 at University as an add-on to my MSc because I
needed to use our Elliott 503 to analyse output from the Moessbauer
spectrometer I was using as part of my thesis.
 
S

Stefan Ram

Patricia Shanahan said:
I am not sure hours of instruction are the important thing for
programming language learning. How much time are the students able and
willing to spend outside class?

No time. The classes are visited by employees, pupils, and
students, who need or want to use the rest of their time
for their job/life, school, or university. When I tried to
give homework, it was never done.
I wonder whether the Java and EBNF could be taught in parallel without
causing confusion. For example, teach enough Java to write a very simple
application, then show a simplified extract of the Java grammar that is
sufficient to derive the applications the students now know how to write.

Yes, I tried this. From the beginning I only showed a
simplified grammar restricted to the parts that are actually
used in class, but even that was too hard. But maybe I'll
try »railroad diagrams« as used in Pascal. It should make
clear that this is not intended to become a part of Java
source code.

For example, the curly braces: Some of my students don't
even know the German name of the character »{« when they
come into my class. It seems they never encountered this
symbol before in their life. Suddenly they see it in both
Java and EBNF with two totally different meanings. That
seems to be too much.
 
E

Eric Sosman

No time. The classes are visited by employees, pupils, and
students, who need or want to use the rest of their time
for their job/life, school, or university. When I tried to
give homework, it was never done.

That's too bad. Programming is not just an abstract body of
knowledge, a list of facts and theorems. Programming is also a
craft requiring skills, skills that are acquired (and maintained)
by practice. No practice -> no programmer.
 
S

Stefan Ram

Eric Sosman said:
That's too bad. Programming is not just an abstract body of
knowledge, a list of facts and theorems. Programming is also a
craft requiring skills, skills that are acquired (and maintained)
by practice. No practice -> no programmer.

That's why we do some exercises in class. But the time
restriction of about 18 hours plus optional 12 to 18 hours
is a severe restriction in this case. However, in the end,
it is the decision of the students how much time they want
to spent. After all, they also pay the class per hour. Maybe
some students continue to learn Java after the end of the
class by other means, but I don't get to know about this.
 
G

Gene Wirchenko

No time. The classes are visited by employees, pupils, and
students, who need or want to use the rest of their time
for their job/life, school, or university. When I tried to
give homework, it was never done.

They have time. They just choose to spend it otherwise. Not
spending enough time with programming means one does not become
competent. While acknowledging that it is their choice, I would make
that clear in class.
Yes, I tried this. From the beginning I only showed a
simplified grammar restricted to the parts that are actually
used in class, but even that was too hard. But maybe I'll
try »railroad diagrams« as used in Pascal. It should make
clear that this is not intended to become a part of Java
source code.

For example, the curly braces: Some of my students don't
even know the German name of the character »{« when they
come into my class. It seems they never encountered this
symbol before in their life. Suddenly they see it in both
Java and EBNF with two totally different meanings. That
seems to be too much.

You are trying to teach the functionally illiterate how to
program?

Sincerely,

Gene Wirchenko
 

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

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top