Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: void Date: Sat, 16 Jul 2016 18:34:30 -0400 Organization: Aioe.org NNTP Server Lines: 38 Message-ID: References: NNTP-Posting-Host: 7SK6yTFfqwlIPNBLl3l7Qg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:34928 On 7/16/2016 6:20 PM, Stefan Ram wrote: > On several occassions I have observed that the compiler, javac, > has it's own vocabulary. For example, it uses words like »context« > or »symbol« that might not be used this way in the JLS. > > Another example I encountered today: > > The JLS does not seem to think of »void« as a »type«. It says: > > 8.4.5 Method Result > > The result of a method declaration either declares the type of > value that the method returns (the return type), or uses the > keyword void to indicate that the method does not return a value. > > (end of quotation). > > But for the compiler, it seems to be a »type«: > > Main.java:3: error: 'void' type not allowed here > java.lang.System.out.println( java.lang.System.out.println() ); }} > ^ > > This can be confusing for teachers and students. Often they > will not be consciously aware of the different systems of concepts > because they often do not study the JLS and the error messages > in such a depth, but they might subconsciously feel irritated > and get the feeling that something is confusing. I will argue a more practical focused perspective: does the error message clearly tell the developer what the problem is? I think it does. Then I think it is all fine. Whether void is a type or not is an academic discussion with little practical relevance. Arne