<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: JavaNG: A Better Java &#8211; What would you do?</title>
	<atom:link href="http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/</link>
	<description>Rants and opinion interspersed with awe-inspiring tales of heoric software engineering endeavours.</description>
	<lastBuildDate>Tue, 17 Aug 2010 03:04:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Mark Thornton</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-687</link>
		<dc:creator>Mark Thornton</dc:creator>
		<pubDate>Thu, 21 Feb 2008 22:41:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-687</guid>
		<description>An object can define a protected clone method if it wishes to restrict access. If the Cloneable interface had specified the clone method this would not be possible. Whether anyone actually does this is another question.

I understand that, even with the best compiler technology, eliminating primitives still has a noticeable performance cost for some types of computation.</description>
		<content:encoded><![CDATA[<p>An object can define a protected clone method if it wishes to restrict access. If the Cloneable interface had specified the clone method this would not be possible. Whether anyone actually does this is another question.</p>
<p>I understand that, even with the best compiler technology, eliminating primitives still has a noticeable performance cost for some types of computation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roel Spilker</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-317</link>
		<dc:creator>Roel Spilker</dc:creator>
		<pubDate>Sun, 13 Jan 2008 21:25:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-317</guid>
		<description>1) Have an (optional) character-encoding on the first line. Useful for both compilers and IDEs.
2) Introduce an Id type, similar to String but also to Long. Great for equality testing, lookup though String value possible.
3) Remove equals and hashCode from Object. It is only used in HashMaps and HashSets and if is currently too difficult to get it right. Introduce a new interface to contain these methods.</description>
		<content:encoded><![CDATA[<p>1) Have an (optional) character-encoding on the first line. Useful for both compilers and IDEs.<br />
2) Introduce an Id type, similar to String but also to Long. Great for equality testing, lookup though String value possible.<br />
3) Remove equals and hashCode from Object. It is only used in HashMaps and HashSets and if is currently too difficult to get it right. Introduce a new interface to contain these methods.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Howard Lovatt</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-306</link>
		<dc:creator>Howard Lovatt</dc:creator>
		<pubDate>Fri, 11 Jan 2008 20:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-306</guid>
		<description>Oops the generics didn&#039;t come out, below I have used [] instead of angle brackets for the code

[E0, E1] T2[E0, E1] swap(E0 e0, E1 e1) { return t(e1, e0); }

If you had native tuples the above might look like

[E0, E1] (E0, E1) swap(E0 e0, E1 e1) { return (e1, e0); }

As you can see; not very different. The main difference would be access to the tuple members via .e0 etc., e.g.:

T2[Integer, Integer] maxMin = t( 0, 1 );
maxMin = swap(maxMin.e0, minMax.e1);

As opposed to:

(Integer max, Integer min) = ( 0, 1 );
(max, min) = swap(min, max);

On the other hand you can do:

class MyClass extends T2[Integer, Integer] { ... }

with the library; most languages that have tuples don&#039;t allow you to extend the tuple class.</description>
		<content:encoded><![CDATA[<p>Oops the generics didn&#8217;t come out, below I have used [] instead of angle brackets for the code</p>
<p>[E0, E1] T2[E0, E1] swap(E0 e0, E1 e1) { return t(e1, e0); }</p>
<p>If you had native tuples the above might look like</p>
<p>[E0, E1] (E0, E1) swap(E0 e0, E1 e1) { return (e1, e0); }</p>
<p>As you can see; not very different. The main difference would be access to the tuple members via .e0 etc., e.g.:</p>
<p>T2[Integer, Integer] maxMin = t( 0, 1 );<br />
maxMin = swap(maxMin.e0, minMax.e1);</p>
<p>As opposed to:</p>
<p>(Integer max, Integer min) = ( 0, 1 );<br />
(max, min) = swap(min, max);</p>
<p>On the other hand you can do:</p>
<p>class MyClass extends T2[Integer, Integer] { &#8230; }</p>
<p>with the library; most languages that have tuples don&#8217;t allow you to extend the tuple class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Howard Lovatt</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-304</link>
		<dc:creator>Howard Lovatt</dc:creator>
		<pubDate>Fri, 11 Jan 2008 20:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-304</guid>
		<description>Good post - a couple of things I have suggested:

1. Add a source keyword so that you can mark a file as Java 7, then you don&#039;t need to worry so much about backward compatibility and you can fix up the errors from the past (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519124)

2. You can write a good tuple library already using generics:

 T2 swap(E0 e0, E1 e1) { return t(e1, e0); }

Note generics and ease of construction.

You can see the code and more examples at:

http://code.google.com/p/google-collections/issues/detail?id=43</description>
		<content:encoded><![CDATA[<p>Good post &#8211; a couple of things I have suggested:</p>
<p>1. Add a source keyword so that you can mark a file as Java 7, then you don&#8217;t need to worry so much about backward compatibility and you can fix up the errors from the past (<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519124" rel="nofollow">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6519124</a>)</p>
<p>2. You can write a good tuple library already using generics:</p>
<p> T2 swap(E0 e0, E1 e1) { return t(e1, e0); }</p>
<p>Note generics and ease of construction.</p>
<p>You can see the code and more examples at:</p>
<p><a href="http://code.google.com/p/google-collections/issues/detail?id=43" rel="nofollow">http://code.google.com/p/google-collections/issues/detail?id=43</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Casper</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-303</link>
		<dc:creator>Casper</dc:creator>
		<pubDate>Fri, 11 Jan 2008 15:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-303</guid>
		<description>JavaNG sounds like a tropical island with blue lagoons, palm trees and bikinis ladies with... agh snap out of it, back to the cold city with it&#039;s graffiti covered concrete and rat infested sewages.

I would add properties and events (delegates), fix the lousy component model, make sure versioning is build in (i.e. non-virtual methods by default etc.) and drop pluggable L&amp;F (people on a mac want the mac stuff and so forth). Operator overloading is long needed to fix a bunch of horrific API&#039;s, nullable types would be nice, but for god sake get rid of the primitive types and add inference (would also fix the tuple issue). Oh god I want to go to that island so bad!</description>
		<content:encoded><![CDATA[<p>JavaNG sounds like a tropical island with blue lagoons, palm trees and bikinis ladies with&#8230; agh snap out of it, back to the cold city with it&#8217;s graffiti covered concrete and rat infested sewages.</p>
<p>I would add properties and events (delegates), fix the lousy component model, make sure versioning is build in (i.e. non-virtual methods by default etc.) and drop pluggable L&amp;F (people on a mac want the mac stuff and so forth). Operator overloading is long needed to fix a bunch of horrific API&#8217;s, nullable types would be nice, but for god sake get rid of the primitive types and add inference (would also fix the tuple issue). Oh god I want to go to that island so bad!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Miller - Java 7 Roundup (Jan 10th)</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-300</link>
		<dc:creator>Alex Miller - Java 7 Roundup (Jan 10th)</dc:creator>
		<pubDate>Fri, 11 Jan 2008 05:13:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-300</guid>
		<description>[...] but it&#8217;s a mature language, so it will evolve slowly. I&#8217;ll also throw out a link to Dan&#8217;s post on Java NG as a fun place to throw out ideas on what you could do with all constraints [...]</description>
		<content:encoded><![CDATA[<p>[...] but it&#8217;s a mature language, so it will evolve slowly. I&#8217;ll also throw out a link to Dan&#8217;s post on Java NG as a fun place to throw out ideas on what you could do with all constraints [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-292</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Wed, 09 Jan 2008 12:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-292</guid>
		<description>&quot;Stephan, am I right in thinking that your Ã¢â‚¬Å“structual typingÃ¢â‚¬Â is analogous to &#039;duck typing&#039; in Ruby?&quot;

No structural typing is static and type safe. Duck typing is currently associated with dynamic typing. I guess some people would call &quot;structural typing&quot; chicken typing. But only because they have never been biten by a nasty type bug which had costed them k&#039;s of USD.

&quot;However, I donÃ¢â‚¬â„¢t see having to declare Ã¢â‚¬Å“implements MyInterfaceÃ¢â‚¬Â as being a problem in Java.&quot;

a.) It creates a _broad_ dependency. Often too broad.
b.) What if you do not control the code to declare the dependency?

Peace
-stephan</description>
		<content:encoded><![CDATA[<p>&#8220;Stephan, am I right in thinking that your Ã¢â‚¬Å“structual typingÃ¢â‚¬Â is analogous to &#8216;duck typing&#8217; in Ruby?&#8221;</p>
<p>No structural typing is static and type safe. Duck typing is currently associated with dynamic typing. I guess some people would call &#8220;structural typing&#8221; chicken typing. But only because they have never been biten by a nasty type bug which had costed them k&#8217;s of USD.</p>
<p>&#8220;However, I donÃ¢â‚¬â„¢t see having to declare Ã¢â‚¬Å“implements MyInterfaceÃ¢â‚¬Â as being a problem in Java.&#8221;</p>
<p>a.) It creates a _broad_ dependency. Often too broad.<br />
b.) What if you do not control the code to declare the dependency?</p>
<p>Peace<br />
-stephan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-268</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 04 Jan 2008 18:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-268</guid>
		<description>Stephan, am I right in thinking that your &quot;structual typing&quot; is analogous to &quot;duck typing&quot; in Ruby?

I think that&#039;s a pretty fundamental change to the type system and would require a new way of thinking when developing.  It would however make my point about Cloneable irrelevant - we wouldn&#039;t need a Cloneable interface, so I can see the attraction for simple interfaces.

However, I don&#039;t see having to declare &quot;implements MyInterface&quot; as being a problem in Java.

The argument I&#039;ve seen made against duck typing is the (extremely contrived) example of the ZipFile and the AtomicBomb types that both have an explode() method.  Use the wrong object and you&#039;ll get a rather different result that the one you expect.

I&#039;m definitely with you on point 3 (ClassCastExceptions).  There are no backwards-compatibility excuses for not doing this right now.</description>
		<content:encoded><![CDATA[<p>Stephan, am I right in thinking that your &#8220;structual typing&#8221; is analogous to &#8220;duck typing&#8221; in Ruby?</p>
<p>I think that&#8217;s a pretty fundamental change to the type system and would require a new way of thinking when developing.  It would however make my point about Cloneable irrelevant &#8211; we wouldn&#8217;t need a Cloneable interface, so I can see the attraction for simple interfaces.</p>
<p>However, I don&#8217;t see having to declare &#8220;implements MyInterface&#8221; as being a problem in Java.</p>
<p>The argument I&#8217;ve seen made against duck typing is the (extremely contrived) example of the ZipFile and the AtomicBomb types that both have an explode() method.  Use the wrong object and you&#8217;ll get a rather different result that the one you expect.</p>
<p>I&#8217;m definitely with you on point 3 (ClassCastExceptions).  There are no backwards-compatibility excuses for not doing this right now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-265</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Fri, 04 Jan 2008 13:40:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-265</guid>
		<description>Wordpress comments thought my type annotations where HTML and removed them. 

public void myFoo(T[public void doFoo()] foo) 

to express that myFoo works with any type that has a doFoo method.</description>
		<content:encoded><![CDATA[<p>Wordpress comments thought my type annotations where HTML and removed them. </p>
<p>public void myFoo(T[public void doFoo()] foo) </p>
<p>to express that myFoo works with any type that has a doFoo method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephan Schmidt</title>
		<link>http://blog.uncommons.org/2008/01/04/javang-a-better-java-what-would-you-do/comment-page-1/#comment-263</link>
		<dc:creator>Stephan Schmidt</dc:creator>
		<pubDate>Fri, 04 Jan 2008 09:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.uncommons.org/?p=55#comment-263</guid>
		<description>1.) Properties. This reduces noise by removing simple setter and getters
2.) Nice option types. The biggest problem currently left in Java are NPEs. Most other problems have been delt with compared to C++
3.) Better class cast exception descriptions. WHAT was tried to cast to WHAT? The current description is plain unusable (And WHERE was the object with the wrong type created?) Also see next, structural typing.
4.) Structural typing. This would make reuse much easier. 

interface Foo {
   public void doFoo();
}

Currently Java (contrary to Scala) only has declarative typing. So I only can call 

public void myFoo(Foo foo) 

with an object that DECLARES to implement foo. Java should look at my object if it does &quot;implement&quot; Foo by structural comparison, not because someone declared it to implement Foo. The Scala way of saying

public void myFoo(T foo) 

is more powerfull, but less readable. I would prefer the interface way.

Peace
-stephan</description>
		<content:encoded><![CDATA[<p>1.) Properties. This reduces noise by removing simple setter and getters<br />
2.) Nice option types. The biggest problem currently left in Java are NPEs. Most other problems have been delt with compared to C++<br />
3.) Better class cast exception descriptions. WHAT was tried to cast to WHAT? The current description is plain unusable (And WHERE was the object with the wrong type created?) Also see next, structural typing.<br />
4.) Structural typing. This would make reuse much easier. </p>
<p>interface Foo {<br />
   public void doFoo();<br />
}</p>
<p>Currently Java (contrary to Scala) only has declarative typing. So I only can call </p>
<p>public void myFoo(Foo foo) </p>
<p>with an object that DECLARES to implement foo. Java should look at my object if it does &#8220;implement&#8221; Foo by structural comparison, not because someone declared it to implement Foo. The Scala way of saying</p>
<p>public void myFoo(T foo) </p>
<p>is more powerfull, but less readable. I would prefer the interface way.</p>
<p>Peace<br />
-stephan</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.384 seconds -->
