Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: Java puzzler Date: Thu, 12 May 2011 10:14:18 -0400 Organization: A noiseless patient Spider Lines: 34 Message-ID: References: <871987d9-1034-441d-9d33-b2dd6b4de234@glegroupsg2000goo.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 12 May 2011 14:14:20 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3xSaU6y5tAyBQEIxw+DaTw"; logging-data="3455"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Qd5MsCLLM83BBl7i5suENDoz0e1EHDgg=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16pre) Gecko/20110305 Lightning/1.0b3pre Thunderbird/3.1.10pre In-Reply-To: Cancel-Lock: sha1:eJbZgKrXTWzCPMeXEGSB/vja28E= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4009 On 05/12/2011 01:02 AM, Roedy Green wrote: > When I read the JLS, it always seems to me extremely ambiguous. I > would never trust my interpretation. Others seem to understand its > language patterns more deeply and with confidence divine what it > means. It may be that they have done more experiments and have at a > gut level learned the sort of language Mr. Gosling uses. The JLS is quite rigidly specified, at least in comparison to other specifications I have read (e.g., CSS). It is also well-organized compared to, say, C++, where I have to spend a lot of time trying to figure out which clause covers the question I have (I want to know about something involving default initialization of templatized POD-classes... only could be in about 5 sections). > Interpreting the JLS is a special skill quite different from > programming. Much of the programming I have done has required me to read, write, comprehend, synthesize, and implement specifications, be it as long and dense as that for a programming language, as underspecified as an old RFC that predates most concerns for i18n, as formal as the formal project specification, or as informal as the API documentation. Specifications like the JLS are merely API documentation at another level: every token is an input to the function "Compile and run me!" provided by javac and java, with the JLS merely being a thorough exposition on the wonderous ways that tokens interact with each other. In that vein, every programmer should have the skills to read, comprehend, and interpret the JLS, since they should have the same skills to read, comprehend, and interpret API documentation. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth