Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Static type checking: hybrid mode in Groovy Date: Thu, 17 Nov 2011 10:32:54 -0800 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <61e17074-e229-4303-a549-2389ccf502d3@m10g2000vbc.googlegroups.com> <4njac7ttrpfca17vtgcesuq9buli0hgls3@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 17 Nov 2011 18:32:56 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="9855"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GbnbSmuUzOj/nM3UiZsdnSgcdUKjDJqs=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <4njac7ttrpfca17vtgcesuq9buli0hgls3@4ax.com> Cancel-Lock: sha1:7ISegWuRZAHIbwuOv+ftsOGbQUk= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10013 On 11/17/2011 10:25 AM, Gene Wirchenko wrote: > written was something like: > if (cParsedWord=="$define") > Instead, I had to write: > if (cParsedWord.equals("$define")) > Without that method, it was something like: > if (cParsedWord.Value.toString().equals("$define")) In all honesty, I prefer the last one. At least I can see what is going on, and I don't think it is long at all. There are plenty of good examples where Java is verbose. This isn't one of them. And overriding "equals" in this way is pernicious. [[Snipped a lot of very nasty source code]] > void Set > ( > String theString > ) > { > this.Value.replace(0,this.Value.length(),theString); > } > } > > Death by a thousand cuts. If you're referring to whomever invented that source formatting style, then yeah, it's grody. But that's not Java's fault.