Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Assigning void Date: Sat, 13 Oct 2012 15:08:57 -0400 Organization: A noiseless patient Spider Lines: 46 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 13 Oct 2012 19:02:51 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="6a6a291fa7e9c0bd872c1a9cbe2b371d"; logging-data="24831"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WsNmwXGS8g8o23xUrzWSMGQi6T2fDhWM=" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120925 Icedove/3.0.11 In-Reply-To: Cancel-Lock: sha1:NopbSstIeeTdY9ntolz1mo2T0eQ= Xref: csiph.com comp.lang.java.programmer:19288 On 10/13/2012 02:51 PM, markspace wrote: > On 10/12/2012 10:54 PM, Wojtek wrote: >> both ftp methods return void. I would think that the compiler would >> be smart enough to realize that nothing CAN be returned. > > > On 10/13/2012 11:26 AM, Jeff Higgins wrote: >> Does it sound childish to ask why? > > > The way the OP puts it, yes, it comes across as a bit childish. The OP > didn't ask "why," he asked for "thoughts." My thought is "read the JLS." > > I realize *you* asked why, but in the vein of the OP's premise, I feel > "read the spec" is a valid answer. "Why" requires reading someone's > mind, and time travel. Since those are obviously impossible, the result > borders on trolling. > > I'd guess that the original intent and the current thinking is that Java > should be "easy to read" and that shortening branch flow to a single > character pushes somebody's Perl buttons, but that's a total guess. > > What about this: > > (some large expression || some other large expression ) > ? { > Statement; > Statement; > Statement; > } : { > Statement; > Statement; > Statement; > } > > ? Do we really want to go there? I suppose it would be allowed in my boolean expression ? block : block ; and would probably be ugly per your example. But I think (server.getConnectionType() == ConnectionType.ACTIVE) ? ftp.enterLocalActiveMode() : ftp.enterLocalPassiveMode(); would be pretty.