Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #15895 > unrolled thread
| Started by | "mmc.java" <michael.p.mulligan@gmail.com> |
|---|---|
| First post | 2012-07-09 07:54 -0700 |
| Last post | 2012-07-16 02:53 -0700 |
| Articles | 20 on this page of 36 — 14 participants |
Back to article view | Back to comp.lang.java.programmer
Arrays in java "mmc.java" <michael.p.mulligan@gmail.com> - 2012-07-09 07:54 -0700
Re: Arrays in java Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-09 11:30 -0400
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-09 15:03 -0700
Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-09 15:16 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-09 16:14 -0700
Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-09 21:43 -0700
Re: Arrays in java Lew <noone@lewscanon.com> - 2012-07-09 23:47 -0700
Re: Arrays in java Roedy Green <see_website@mindprod.com.invalid> - 2012-07-11 15:32 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-11 16:21 -0700
Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-11 17:08 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-11 17:20 -0700
Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-11 22:09 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-12 11:31 -0700
Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-13 09:07 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-13 13:00 -0700
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-15 00:54 -0500
Re: Arrays in java Jeff Higgins <jeff@invalid.invalid> - 2012-07-16 15:59 -0400
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-16 23:44 -0700
Re: Arrays in java glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-07-17 08:01 +0000
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 03:04 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-17 13:02 -0700
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 22:03 -0700
Re: Arrays in java Lew <noone@lewscanon.com> - 2012-07-17 22:10 -0700
Re: Arrays in java glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-07-18 05:12 +0000
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 22:39 -0700
Re: Arrays in java Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-18 21:24 +0000
Re: teaching Java and formal grammars Patricia Shanahan <pats@acm.org> - 2012-07-19 06:48 -0700
Re: teaching Java and formal grammars Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-19 10:27 -0400
Re: teaching Java and formal grammars Gene Wirchenko <genew@ocis.net> - 2012-07-19 10:55 -0700
Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-13 08:28 -0500
Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-11 18:33 -0700
Re: Arrays in java markspace <-@.> - 2012-07-09 09:17 -0700
Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-09 12:56 -0700
Re: Arrays in java Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-07-09 12:45 -0400
Re: Arrays in java Roedy Green <see_website@mindprod.com.invalid> - 2012-07-09 11:03 -0700
Re: Arrays in java Arun GOPI <arun041@gmail.com> - 2012-07-16 02:53 -0700
Page 1 of 2 [1] 2 Next page →
| From | "mmc.java" <michael.p.mulligan@gmail.com> |
|---|---|
| Date | 2012-07-09 07:54 -0700 |
| Subject | Arrays in java |
| Message-ID | <7eb3b37e-612a-4f51-98e5-f39cfd565739@googlegroups.com> |
I am just starting to learn java and wanted to know when creating an array if there is any reason why you choose one of the following over the others or if it is just a styling choice by the developer
int productIDs[] = {10,20,30};
int []productIDs = {10,20,30};
int[] productIDs = {10,20,30};
I did notice the the following will cause a compilation error
[]int productIDs = {10,20,30}; //causes an error
[toc] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-07-09 11:30 -0400 |
| Message-ID | <jtetf3$80q$1@dont-email.me> |
| In reply to | #15895 |
On 7/9/2012 10:54 AM, mmc.java wrote:
> I am just starting to learn java and wanted to know when creating an array if there is any reason why you choose one of the following over the others or if it is just a styling choice by the developer
>
> int productIDs[] = {10,20,30};
> int []productIDs = {10,20,30};
> int[] productIDs = {10,20,30};
All are equivalent. The first suggests the code was written by
an immigrant from C or C++, the last is the style usually seen in
Java, and the middle is just plain ugly.
> I did notice the the following will cause a compilation error
> []int productIDs = {10,20,30}; //causes an error
So will
int productIDs = []{10,20,30};
int productIDs = {10,20,30}[];
int productIDs = {[10,20,30]};
productIDs int[] = {10,20,30};
... and a lot of other random stuff, too.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-09 15:03 -0700 |
| Message-ID | <cpednYtiE_GHyGbSnZ2dnUVZ_uidnZ2d@earthlink.com> |
| In reply to | #15896 |
Eric Sosman wrote:
> On 7/9/2012 10:54 AM, mmc.java wrote:
...
>> I did notice the the following will cause a compilation error
>> []int productIDs = {10,20,30}; //causes an error
>
> So will
>
> int productIDs = []{10,20,30};
> int productIDs = {10,20,30}[];
> int productIDs = {[10,20,30]};
> productIDs int[] = {10,20,30};
>
> ... and a lot of other random stuff, too.
>
I think the OP may be trying to find out why one totally illogical
placement of the "[]" works, although another, slightly less illogical,
placement does not. At least "[]int" keeps all the type information
together.
The answer, already given, is to allow C and C++ programmers to use a
familiar order.
Patricia
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2012-07-09 15:16 -0700 |
| Message-ID | <uLIKr.3063$Kb4.1161@newsfe20.iad> |
| In reply to | #15901 |
On 7/9/12 3:03 PM, Patricia Shanahan wrote:
> Eric Sosman wrote:
>> On 7/9/2012 10:54 AM, mmc.java wrote:
> ...
>>> I did notice the the following will cause a compilation error
>>> []int productIDs = {10,20,30}; //causes an error
>>
>> So will
>>
>> int productIDs = []{10,20,30};
>> int productIDs = {10,20,30}[];
>> int productIDs = {[10,20,30]};
>> productIDs int[] = {10,20,30};
>>
>> ... and a lot of other random stuff, too.
>>
>
> I think the OP may be trying to find out why one totally illogical
> placement of the "[]" works, although another, slightly less illogical,
> placement does not. At least "[]int" keeps all the type information
> together.
>
> The answer, already given, is to allow C and C++ programmers to use a
> familiar order.
>
> Patricia
Here is one that'll blow your mind:
int[] arr[] = {{},{1},{2,3},{4,5,6}};
I'm guessing you could even do "int[] []arr[]"
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-09 16:14 -0700 |
| Message-ID | <2323c0cd-d843-460b-b39d-d14be0928eff@googlegroups.com> |
| In reply to | #15902 |
Daniel Pitts wrote:
> Here is one that'll blow your mind:
>
> int[] arr[] = {{},{1},{2,3},{4,5,6}};
>
> I'm guessing you could even do 'int[] []arr[]';
Yes, but the JLS strongly discourages that.
“Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration:
“ float[][] f[][], g[][][], h[]; // Yechh!
“We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.”
<http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2>
Know. Don't guess. Read the JLS.
Chant 12 times until it's ingrained in your subconscious.
--
Lew
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2012-07-09 21:43 -0700 |
| Message-ID | <VpOKr.31235$7y4.10179@newsfe23.iad> |
| In reply to | #15904 |
On 7/9/12 4:14 PM, Lew wrote:
> Daniel Pitts wrote:
>> Here is one that'll blow your mind:
>>
>> int[] arr[] = {{},{1},{2,3},{4,5,6}};
>>
>> I'm guessing you could even do 'int[] []arr[]';
>
> Yes, but the JLS strongly discourages that.
>
> “Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration:
>
> “ float[][] f[][], g[][][], h[]; // Yechh!
>
> “We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.”
>
> <http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2>
>
> Know. Don't guess. Read the JLS.
If it was something I cared to know, I would have. I know that even if
it was valid, I would never use it. If I ever encountered it, I would
look up the rules on how exactly it works.
I was mostly just being goofy with examples of what can be done, even if
it should be avoided.
[toc] | [prev] | [next] | [standalone]
| From | Lew <noone@lewscanon.com> |
|---|---|
| Date | 2012-07-09 23:47 -0700 |
| Message-ID | <jtgj6a$1or$1@news.albasani.net> |
| In reply to | #15909 |
On 07/09/2012 09:43 PM, Daniel Pitts wrote:
> On 7/9/12 4:14 PM, Lew wrote:
>> Daniel Pitts wrote:
>>> Here is one that'll blow your mind:
>>>
>>> int[] arr[] = {{},{1},{2,3},{4,5,6}};
>>>
>>> I'm guessing you could even do 'int[] []arr[]';
>>
>> Yes, but the JLS strongly discourages that.
>>
>> “Brackets are allowed in declarators as a nod to the tradition of C and C++.
>> The general rules for variable declaration, however, permit brackets to
>> appear on both the type and in declarators, so that the local variable
>> declaration:
>>
>> “ float[][] f[][], g[][][], h[]; // Yechh!
>>
>> “We do not recommend "mixed notation" in an array variable declaration,
>> where brackets appear on both the type and in declarators.”
>>
>> <http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2>
>>
>> Know. Don't guess. Read the JLS.
> If it was something I cared to know, I would have. I know that even if it was
> valid, I would never use it. If I ever encountered it, I would look up the
> rules on how exactly it works.
>
> I was mostly just being goofy with examples of what can be done, even if it
> should be avoided.
Sorry, I should have made it clear that I was speaking of general principle
for the wider audience. If anything I should have emphasized the validity of
your observation.
But lately in particular, and for a long time in general, I have seen a
tendency for programmers to assume or guess or infer or imagine technical
information that is readily and authoritatively available. The Internet
removes much of the excuse for uncertainty, pretty much all of it when it
comes to Java. Especially things that are baldly and rather aggressively
stated in the single most seminal and normative Java specification there is,
the Java specification itself.
I found the under-five minutes to confirm this particular nugget, via a link
that had been posted in this very thread multiple times already by Roedy and
others, to be a negligible burden to incur prior to averring the validity of
your observation.
--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-07-11 15:32 -0700 |
| Message-ID | <5bvrv7l6m37aha6n3ri5giatrarpeb6boe@4ax.com> |
| In reply to | #15904 |
On Mon, 9 Jul 2012 16:14:36 -0700 (PDT), Lew <lewbloch@gmail.com> wrote, quoted or indirectly quoted someone who said : >Know. Don't guess. Read the JLS. And I have explained to you many times that not everyone can make hide nor tail of that lawyerly document. YOU can, but perhaps only one in 100 programmers can accurately decode it. It is plain rude to demand newbies use it. Encourage them yes, but don't pretend it as a skill everyone is suppose to master to justify their existence. You are using it like some frat hazing. I further hazard a guess your own ability to decode is somewhat higher than it is in reality. You just assert your interpretation is the correct one. Any time I read that fool think I can come up with 4 possible interpretations. . The fault it is the document. It was not written for average programmers but to settle lawyerly disputes over compiler compliance. That is why they are so many text books to explain these things in English to programmers. -- Roedy Green Canadian Mind Products http://mindprod.com Mathematicians and computer scientists are far more interested in impressing you than informing you. If this were not so, the tutorials on building a robots.txt file, for example, would consist primarily of an annotated example. What you get instead are nothing but inscrutable adstract fragments in some obscure dialect of BNF.
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-11 16:21 -0700 |
| Message-ID | <80b9a66d-0b65-435b-adbb-3e61c83c6a54@googlegroups.com> |
| In reply to | #15953 |
Roedy Green wrote: > Lew wrote, quoted or indirectly quoted someone who said : > >Know. Don't guess. Read the JLS. > > And I have explained to you many times that not everyone can make hide > nor tail of that lawyerly document. YOU can, but perhaps only one in > 100 programmers can accurately decode it. It is plain rude to demand > newbies use it. Encourage them yes, but don't pretend it as a skill It is plain stupid and evil of you to recommend that newbies not use it. It is the seminal authoritative document that defines Java. Your rabid insistence that people ignore it is a huge disservice to those learning the language. > everyone is suppose to master to justify their existence. You are > using it like some frat hazing. Which is the better advice in computer programming, to study toward an understanding in depth the core definition of the language, or to avoid studying the definition of the language? What is your problem that gets you foaming at the mouth for the mere suggestion that the JLS is the core and pinnacle of knowledge about the definition of the language? Your attitude is as inexplicable as it is hostile and damaging to those seeking better knowledge. > I further hazard a guess your own ability to decode is somewhat higher > than it is in reality. You just assert your interpretation is the > correct one. Any time I read that fool think I can come up with 4 Show me where I'm wrong. I'm open to learning new things. Are you? Why are you so adamant that others recapitulate your shortcomings? > possible interpretations. . The fault it is the document. It was not > written for average programmers but to settle lawyerly disputes over > compiler compliance. That is why they are so many text books to > explain these things in English to programmers. What exactly do you find unclear about “Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration: “ float[][] f[][], g[][][], h[]; // Yechh! “We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.” <http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2> I would be glad to help you with it. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2012-07-11 17:08 -0700 |
| Message-ID | <l05sv711f1k182u0qcmn8b66j8t3siie71@4ax.com> |
| In reply to | #15964 |
On Wed, 11 Jul 2012 16:21:48 -0700 (PDT), Lew <lewbloch@gmail.com>
wrote:
>Roedy Green wrote:
>> Lew wrote, quoted or indirectly quoted someone who said :
>> >Know. Don't guess. Read the JLS.
>>
>> And I have explained to you many times that not everyone can make hide
>> nor tail of that lawyerly document. YOU can, but perhaps only one in
>> 100 programmers can accurately decode it. It is plain rude to demand
>> newbies use it. Encourage them yes, but don't pretend it as a skill
>
>It is plain stupid and evil of you to recommend that newbies not use it.
Why? It probably is not intelligible by them.
>It is the seminal authoritative document that defines Java.
Sure.
>Your rabid insistence that people ignore it is a huge disservice to those
>learning the language.
He is not doing that.
>> everyone is suppose to master to justify their existence. You are
>> using it like some frat hazing.
>
>Which is the better advice in computer programming, to study toward
>an understanding in depth the core definition of the language, or
>to avoid studying the definition of the language?
How about not excluding the middle? I read the spec for
JavaScript and had to give it up partway because so much of it was
just not worth the trouble. Some of it, yes, but other parts were not
very clear for someone studying for use. I expect the JLS has the
same trouble. Most language specs are not written for app programmers
but rather language implementers.
>What is your problem that gets you foaming at the mouth for the
>mere suggestion that the JLS is the core and pinnacle of knowledge
>about the definition of the language? Your attitude is as inexplicable
>as it is hostile and damaging to those seeking better knowledge.
If you are looking for hostility, consider your own.
>> I further hazard a guess your own ability to decode is somewhat higher
>> than it is in reality. You just assert your interpretation is the
>> correct one. Any time I read that fool think I can come up with 4
>
>Show me where I'm wrong. I'm open to learning new things.
>
>Are you?
>
>Why are you so adamant that others recapitulate your shortcomings?
I think he is trying to avoid them hitting a wall.
>> possible interpretations. . The fault it is the document. It was not
>> written for average programmers but to settle lawyerly disputes over
>> compiler compliance. That is why they are so many text books to
>> explain these things in English to programmers.
>
>What exactly do you find unclear about
>
>“Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration:
>
>“ float[][] f[][], g[][][], h[]; // Yechh!
>
>“We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.”
>
><http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2>
>
>I would be glad to help you with it.
That an individual example is clear does not prove that the whole
is clear. Even if all examples are clear, it does not mean that the
whole coheres.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-11 17:20 -0700 |
| Message-ID | <db917672-7676-4739-aedb-686023ec365a@googlegroups.com> |
| In reply to | #15966 |
Gene Wirchenko wrote: > Lew wrote: > >What exactly do you find unclear about > > > >“Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration: > > > >“ float[][] f[][], g[][][], h[]; // Yechh! > > > >“We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.” > > > ><http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2> > > > >I would be glad to help you with it. > > That an individual example is clear does not prove that the whole > is clear. Even if all examples are clear, it does not mean that the > whole coheres. It is the individual example that sparked Roedy's diatribe. Ergo I concluded it must have posed him some difficulties for him to gripe about it. Regardless, Roedy has expressed difficulty with the JLS and I am happy to help him wherever that difficulty lies. I am astounded that you join him in apologetics for ignorance. Programming is a game of knowledge and mastery. If you deliberately exclude the normative documentation for the platform you use, you are hurting yourself. If you recommend that others do so as well, you are hurting them. I extend you the same offer I did to Roedy, Gene. I'd be glad to help you with anything in the JLS you find obscure. What really puzzles me is Roedy's apparent anger at me for recommending the JLS. What the F? Spend the freaking time reading and understanding it, reaching for auxiliary sources (such as those by the JLS's own authors) for the parts that puzzle you. Study it. I've been studying the various incarnations for over a decade. There's no magic, despite how hard Roedy tries to enmystify the process. It's just determination and diligence, and I dare say a modicum of raw talent for programming that many who frequent this forum can lay claim to. Don't be an advocate for laziness and ignorance. Know. Don't guess. Read the JLS. Excoriate anyone who tries to discourage you from doing so. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2012-07-11 22:09 -0700 |
| Message-ID | <comsv79pj7fvi50kaq9rdbvgkdl7q4dkjk@4ax.com> |
| In reply to | #15967 |
On Wed, 11 Jul 2012 17:20:37 -0700 (PDT), Lew <lewbloch@gmail.com>
wrote:
>Gene Wirchenko wrote:
>> Lew wrote:
>> >What exactly do you find unclear about
>> >
>> >“Brackets are allowed in declarators as a nod to the tradition of C and C++. The general rules for variable declaration, however, permit brackets to appear on both the type and in declarators, so that the local variable declaration:
>> >
>> >“ float[][] f[][], g[][][], h[]; // Yechh!
>> >
>> >“We do not recommend "mixed notation" in an array variable declaration, where brackets appear on both the type and in declarators.”
>> >
>> ><http://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html#jls-10.2>
>> >
>> >I would be glad to help you with it.
>>
>> That an individual example is clear does not prove that the whole
>> is clear. Even if all examples are clear, it does not mean that the
>> whole coheres.
>
>It is the individual example that sparked Roedy's diatribe. Ergo
>I concluded it must have posed him some difficulties for him to
>gripe about it.
>
>Regardless, Roedy has expressed difficulty with the JLS and I am
>happy to help him wherever that difficulty lies.
>
>I am astounded that you join him in apologetics for ignorance.
I do no such thing.
>Programming is a game of knowledge and mastery. If you deliberately
>exclude the normative documentation for the platform you use,
>you are hurting yourself. If you recommend that others do so as well,
>you are hurting them.
I do not. I do suggest that it is not an appropriate document
for a newbie.
>I extend you the same offer I did to Roedy, Gene. I'd be glad to help
>you with anything in the JLS you find obscure.
>
>What really puzzles me is Roedy's apparent anger at me for recommending
>the JLS. What the F? Spend the freaking time reading and understanding it,
>reaching for auxiliary sources (such as those by the JLS's own authors) for
>the parts that puzzle you. Study it. I've been studying the various
>incarnations for over a decade. There's no magic, despite how hard Roedy
>tries to enmystify the process. It's just determination and diligence, and
>I dare say a modicum of raw talent for programming that many who
>frequent this forum can lay claim to.
>
>Don't be an advocate for laziness and ignorance.
>
>Know. Don't guess. Read the JLS.
>
>Excoriate anyone who tries to discourage you from doing so.
I have not read the JLS, but as I noted in my post, I did read
much of the JavaScript standard. There were parts of it that were
very lucid indeed. I expect that the JLS has lucid portions, too.
However, there were parts of the JavaScript standard that were very
obtuse. Were I interested in implementing a JavaScript processor,
they would probably be just about what I needed, but for app
programmer level, no, very unclear. I expect that the same is true
for the JLS.
Langauge standards and language documentation for programmers are
two different things with some overlap. I would not wish the standard
for any language on a newbie to the language. After he has the
basics, yes, it would be appropriate then.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-12 11:31 -0700 |
| Message-ID | <dd343609-d16a-40ea-b2d0-eea9e34c638f@googlegroups.com> |
| In reply to | #15975 |
Gene Wirchenko wrote: ... > I have not read the JLS, but ... -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2012-07-13 09:07 -0700 |
| Message-ID | <eqh008l7d647crjgemm58fn3dpae9vtv34@4ax.com> |
| In reply to | #15986 |
On Thu, 12 Jul 2012 11:31:01 -0700 (PDT), Lew <lewbloch@gmail.com>
wrote:
>Gene Wirchenko wrote:
>...
>> I have not read the JLS, but ...
Ad hommuch?
Patricia Shanahan states that she has read the JLS several times
and that she agrees with me. What cheap shot are you going to use
against her?
Language standards have uses, but one of them is not learning the
language from the start.
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-13 13:00 -0700 |
| Message-ID | <b299251e-3ecc-4c33-a3a2-95ed410229c9@googlegroups.com> |
| In reply to | #15999 |
Gene Wirchenko wrote: > Lew wrote: > >Gene Wirchenko wrote: > >... > >> I have not read the JLS, but ... > > Ad hommuch? > > Patricia Shanahan states that she has read the JLS several times > and that she agrees with me. What cheap shot are you going to use > against her? > > Language standards have uses, but one of them is not learning the > language from the start. I don't advocate reading the JLS in order to learn the language from the start. If you think that's what I'm saying, read it again. I am advocating not ignoring the JLS, and using it as a reference and an adjunct to learning the language, so that by the time you consider yourself competent in Java there is a reality to that assessment. Let me repeat this to avoid misunderstanding: I do not advocate using the JLS (by itself) to learn Java. I advocate using the JLS to know what is really real about Java I excoriate the advice to avoid the JLS. I didn't hear Patricia say not to study the JLS. I did hear others say that. It is not an ad hominem attack to point out that you are judging the JLS without having even made the attempt to read it. That is a legitimate consideration when considering whether your opinion about the JLS should carry weight. It is nice that you know the term ad hominem; now you need to apply it correctly. Patricia actually has read the JLS, so of course that criticism cannot apply as it does to you, Gene. I also never said that reading the JLS is easy. I am saying that it is necessary. I also claim that actively discouraging people from reading the JLS, most particularly if you yourself have never made the effort, is advocacy for laziness and incompetence. Secondary materials can tell you what they think the JLS means, but you have to watch your sources. I now know, for example, that any opinion Gene has about what is or is not so about Java is suspect, because he has not read it. He depends entirely on indirect sources. If his sources are the likes of Gilead Bracha, James Gosling, Brian Goetz and Josh Bloch then he might have very good knowledge, but I cannot be sure of that. His resistance to the JLS is a telling point against trusting his advice. Patricia has demonstrated again and again that she knows Java better than most people, and that she bases that knowledge in part on studying the JLS. So, Gene, here's to your straw-man arguments: - You refuted the proposition that one should use the JLS to learn Java. Congratulations. No one said you should. - You refuted the proposition that the JLS is an easy read. Congratulations. No one said that it is. Here are the points not refuted and still standing: - 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. - I claimed that it doesn't take special intelligence to study the JLS, only diligence and continued study. No one has tested that proposition either. - 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 don't understand why anyone sane or helpful would attempt to dissuade Java programmers from studying the JLS, or worse yet, be proud that they themselves have not. No wonder there are so many poor programmers in the business. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-15 00:54 -0500 |
| Message-ID | <753113290364023986.961849pats-acm.org@news.west.earthlink.net> |
| In reply to | #16005 |
Lew <lewbloch@gmail.com> 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. I intend commenting on this, but will not do so until I get down to under 10,000 feet, so I can use my laptop. It's hard to be eloquent tapping on an iPhone. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2012-07-16 15:59 -0400 |
| Message-ID | <ju1rn5$1ee$1@dont-email.me> |
| In reply to | #16032 |
On 07/15/2012 01:54 AM, Patricia Shanahan wrote: > Lew<lewbloch@gmail.com> 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. > > I intend commenting on this, but will not do so until I get down to under > 10,000 feet, so I can use my laptop. It's hard to be eloquent tapping on an > iPhone. > <http://www.pocket-lint.com/news/43996/magic-cube-projection-keyboard-preview>
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-16 23:44 -0700 |
| Message-ID | <hKudnboeSo57lJjNnZ2dnUVZ_sSdnZ2d@earthlink.com> |
| In reply to | #16005 |
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
[toc] | [prev] | [next] | [standalone]
| From | glen herrmannsfeldt <gah@ugcs.caltech.edu> |
|---|---|
| Date | 2012-07-17 08:01 +0000 |
| Message-ID | <ju3648$b75$1@speranza.aioe.org> |
| In reply to | #16059 |
Patricia Shanahan <pats@acm.org> wrote:
(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
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-17 03:04 -0700 |
| Message-ID | <OM-dnUbqOqZVpZjNnZ2dnUVZ_v6dnZ2d@earthlink.com> |
| In reply to | #16060 |
glen herrmannsfeldt wrote:
> Patricia Shanahan <pats@acm.org> wrote:
..
>> 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.
In between, there is knowing the ways of writing something that are in
common use. That is the level that is needed to be able to read and
modify normal, reasonably well-written, existing code.
>
>> 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.
Or even best for the same person at different stages in their
professional development.
Patricia
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.lang.java.programmer
csiph-web