Re: Arrays in java
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.
Patricia