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: Stanimir Stamenkov Newsgroups: comp.lang.java.programmer Subject: Re: StringBuilder Difficulties Date: Tue, 05 Jul 2011 23:44:39 +0300 Organization: A noiseless patient Spider Lines: 32 Message-ID: References: <9744m8FpnhU3@mid.individual.net> <6cqp07tiug2nu8u6ififvvek1694fkpfi1@4ax.com> <976q3jF3etU2@mid.individual.net> <978bv1FnqaU1@mid.individual.net> <97ejjfFrh1U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 5 Jul 2011 20:44:35 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="9eTmrOoDkUZt4jkjN/OnZw"; logging-data="4591"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX188eoWSEVYtEyMGCK86X2rZ" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110701 SeaMonkey/2.2 In-Reply-To: X-Face: )>>ChyF_H On 7/4/2011 11:06 PM, super... wrote: >> >> public foobar (int a, String b) { >> x = a + b.length(); >> y = 1.3*x; > > You go through quite a bit of verbiage to justify not typing int and > double in front of those last two lines. Just wanted to point out, Gosu [1] is statically typed language (compiled to a JVM bytecode) with type inference, where one could write: function foobar (a : int, b : String) { var x = a + b.length(); var y = 1.3 * x; The difference with the previously given example seems one still needs variable declaration (using the 'var' keyword). While 'double' and 'int' are short enough, with Gosu one could just write: var a = new MyVeryLongClassName(); which appears even better than the Java 7 <> (diamond) operator. Note Gosu supports explicit variable type declarations, also. [1] http://en.wikipedia.org/wiki/Gosu_%28programming_language%29 -- Stanimir