<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Joe Walker - java tag</title>
  <link>http://directwebremoting.org/blog/joe/tags/java/</link>
  <description>Thoughts on Web Development</description>
  <language>en</language>
  <copyright>Joe Walker</copyright>
  <lastBuildDate>Wed, 23 Jul 2008 11:00:41 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>Big Question for Sun</title>
    <link>http://directwebremoting.org/blog/joe/2008/05/19/big_question_for_sun.html</link>
    
      
        <description>
          &lt;p&gt;It looks from the outside as though every spare resource that Sun has is going into JavaFX. JavaFX may or may not win against Flash/Flex/Air/Silverlight/Android/Ajax, but while Sun is concentrating on FX, it doesn&#039;t appear to be giving the Java language the updates it badly needs.&lt;/p&gt;

&lt;p&gt;Maybe Sun sees Java as &#039;done&#039;. OK, but the Java language has one of the largest developer communities in the world, and they&#039;d like some direction. Where do Sun recommend they go for their server-side development needs in 5 years time?&lt;/p&gt;

&lt;p&gt;Maybe Sun think we should change to JRuby, Scala or Groovy. Maybe there are updates to Java that I don&#039;t know about. If none of the above are the case, the community will eventually disappear into mish-mash of languages that doesn&#039;t have the strength of numbers.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;3:19pm Update: tweaked last paragraph to make the point clearer.&lt;/small&gt;&lt;/p&gt;

        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/joe/2008/05/19/big_question_for_sun.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/joe/2008/05/19/big_question_for_sun.html</guid>
    <pubDate>Mon, 19 May 2008 12:35:45 GMT</pubDate>
  </item>
  
  <item>
    <title>App Engine and Java</title>
    <link>http://directwebremoting.org/blog/joe/2008/04/09/app_engine_and_java.html</link>
    
      
        <description>
          &lt;p&gt;The world is now split into Python programmers, making funny &#039;Goo&#039; noises over &lt;a href=&#034;http://code.google.com/appengine/&#034;&gt;App Engine&lt;/a&gt;, and everyone else who are wondering when/if this will be available in their language or if they are going to have to change their spots.&lt;/p&gt;

&lt;p&gt;Of all the languages to support, I guess Java must be one of the hardest because of the heavyweight runtime and the difficulty in separating code. But it also makes sense because supporting Java might give you quick access to Ruby/JavaScript/etc.&lt;/p&gt;

&lt;p&gt;I have no knowledge of if Google are going to support Java in App Engine, however there are some tea-leaves that can be stretched and rearranged to form a vague picture.&lt;/p&gt;

&lt;p&gt;Some time ago Google &lt;a href=&#034;http://www.infoq.com/news/jsr-284-early-draft&#034;&gt;hired Greg Czajkowski&lt;/a&gt; the lead of &lt;a href=&#034;http://research.sun.com/projects/barcelona/index.html&#034;&gt;Project Barcelona&lt;/a&gt; from Sun. Project Barcelona was where &lt;a href=&#034;http://bitser.net/isolate-interest/&#034;&gt;Isolates&lt;/a&gt; (&lt;a href=&#034;http://jcp.org/en/jsr/detail?id=121&#034;&gt;JSR-121&lt;/a&gt;) came from and the Resource Consumption API (&lt;a href=&#034;http://jcp.org/en/jsr/detail?id=284&#034;&gt;JSR 284&lt;/a&gt;), both of which would help you do this sort of thing. And both of which are now in Final Draft stage.&lt;/p&gt;

&lt;p&gt;I have no idea if this does mean that Google are working on App Engine for Java, but if they do I&#039;m going to claim bragging rights for having &lt;a href=&#034;http://getahead.org/blog/joe/2006/08/31/google_hosting_java_webapps_for_customers.html&#034;&gt;blogged about this 18 months ago&lt;/a&gt;.&lt;/p&gt;

        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/joe/2008/04/09/app_engine_and_java.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/joe/2008/04/09/app_engine_and_java.html</guid>
    <pubDate>Wed, 09 Apr 2008 19:49:56 GMT</pubDate>
  </item>
  
  <item>
    <title> Comparing the Evolution of Java and JavaScript</title>
    <link>http://directwebremoting.org/blog/joe/2007/12/17/comparing_the_evolution_of_java_and_javascript.html</link>
    
      
        <description>
          &lt;h2&gt;Java:&lt;/h2&gt;

&lt;p&gt;Java is the &lt;a href=&#034;http://www.tiobe.com/index.htm?tiobe_index&#034;&gt;most used language&lt;/a&gt; in the known universe. It is also a very simple* language. &lt;a href=&#034;http://gafter.blogspot.com/&#034;&gt;Some people&lt;/a&gt; believe that there is some scope in enabling Java to accommodate more programming styles (e.g. functional programming via &lt;a href=&#034;http://www.javac.info/&#034;&gt;closures&lt;/a&gt;). &lt;a href=&#034;http://www.javalobby.org/java/forums/t104586.html&#034;&gt;Others believe&lt;/a&gt; that being lightweight is a virtue.&lt;/p&gt;

&lt;h2&gt;JavaScript:&lt;/h2&gt;

&lt;p&gt;JavaScript is the &lt;a href=&#034;http://alex.dojotoolkit.org/?p=540&#034;&gt;most deployed language&lt;/a&gt; in the known universe. It is also a very simple* language. &lt;a href=&#034;http://weblogs.mozillazine.org/roadmap/archives/2007/11/my_media_ajax_keynote.html&#034;&gt;Some people&lt;/a&gt; believe that there is some scope in enabling JavaScript to accommodate more programming styles (e.g. &lt;a href=&#034;http://www.ecmascript.org/&#034;&gt;by adding classical inheritance not just prototypal inheritance, and an optional type system&lt;/a&gt;). &lt;a href=&#034;http://blogs.msdn.com/cwilso/archive/2007/10/31/what-i-think-about-es4.aspx&#034;&gt;Others believe&lt;/a&gt; that being lightweight is a virtue.&lt;/p&gt;

&lt;h2&gt;Features:&lt;/h2&gt;

&lt;p&gt;It&#039;s interesting that the current simple version of JavaScript already has the features (i.e. closures) that people want to keep out of Java otherwise it will become too complex, and that Java already has some of the features (i.e. classical inheritance) that people want to keep out of JavaScript, otherwise &lt;em&gt;it&lt;/em&gt; will become to complex.&lt;/p&gt;

&lt;h2&gt;Crossroads:&lt;/h2&gt;

&lt;p&gt;The Java language is challenged by languages such as Ruby, Groovy and even Scala, all of which support closures. The majority of people that have spent serious time with these languages prefer them over Java for at least some set of problems.&lt;/p&gt;

&lt;p&gt;The JavaScript language is challenged by Silverlight. Microsoft try to avoid saying things like &#034;death to Ajax&#034;, but secretly (or not so secretly depending on who you talk to) they would love to control the platform once more, and Silverlight is the latest attempt at regaining control.&lt;/p&gt;

&lt;h2&gt;Features vs. Complexity:&lt;/h2&gt;

&lt;p&gt;Joel noticed that there is a &lt;a href=&#034;http://www.joelonsoftware.com/articles/HighNotes.html&#034;&gt;big difference between good developers and bad developers&lt;/a&gt;. Google noticed it with it&#039;s picky hiring process. On many projects there are a few developers that do all the real work, while others just slow things down.&lt;/p&gt;

&lt;p&gt;But much of the &#034;keep complexity out of the language&#034; debate is aimed at helping the people that write less code anyway.&lt;/p&gt;

&lt;p&gt;Nail-guns and angle grinders are dangerous tools, but the building trade accepts the danger in the name of greater productivity. In software development where the difference between good and bad developers is that much greater, and where developers don&#039;t actually get physically maimed, the argument for power over simplicity is that much stronger.&lt;/p&gt;

&lt;p&gt;In summary, extra power helps smarter developers work more quickly, but makes life harder for less smart developers. Since a small number of smarter developers generally do better work than a large number of no so smart developers, we should tend slightly toward giving developers more powerful tools.&lt;/p&gt;

&lt;h2&gt;Java:&lt;/h2&gt;

&lt;p&gt;In Java, BGGA closures enable higher-order programming. It&#039;s hard to say that the addition of closures in and of itself would cause a complexity implosion, after all, Java is virtually the only modern day programming language without them. It could be argued that the Java language can&#039;t be evolved to accommodate them, but I&#039;m leaning towards there being a net gain by including them.&lt;/p&gt;

&lt;p&gt;Interestingly, &lt;a href=&#034;http://code.google.com/android/&#034;&gt;Google Android&lt;/a&gt; contains a clean room re-implementation of Java. If Sun (or the JCP) accepts closures, and if (as seems likely) Google votes against them, what will happen to Android? Will it follow how Google votes, or how Java evolves?&lt;/p&gt;

&lt;h2&gt;JavaScript:&lt;/h2&gt;

&lt;p&gt;With JavaScript, people see a neat, compact language and fear it turning into Java. The good news is that it won&#039;t fully turn into Java because JavaScript already has closures and no one thinks they should be taken out ;-) The danger of the &#034;features over complexity&#034; argument, is that it can be applied indiscriminately, creating a monster, and the fear is that JavaScript will become a monster.&lt;/p&gt;

&lt;p&gt;I&#039;m gradually coming round to the opinion that many of the changes proposed to JavaScript actually &lt;em&gt;reduce&lt;/em&gt; complexity. There are nearly as many frameworks that add classical inheritance to JavaScript as there are Ajax frameworks. Having one solution that we can all agree on can&#039;t be a bad thing even if you prefer prototypal inheritance.&lt;/p&gt;

&lt;hr/&gt;

&lt;p&gt;*: For some value of simple. The exact definitions of simple used in these 2 paragraphs are not necessarily the same.&lt;/p&gt;

&lt;script type=&#034;text/javascript&#034;&gt;
var dzone_url = &#039;http://getahead.org/blog/joe/2007/12/17/comparing_the_evolution_of_java_and_javascript.html&#039;;
var dzone_title = &#039;Comparing the Evolution of Java and JavaScript&#039;;
var dzone_blurb = &#039;Java is the most used language in the known universe, JavaScript the most deployed and there are some similarities in how they are growing&#039;;
var dzone_style = &#039;1&#039;;
&lt;/script&gt;

&lt;script language=&#034;javascript&#034; src=&#034;http://widgets.dzone.com/widgets/zoneit.js&#034;&gt;&lt;/script&gt;

        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/joe/2007/12/17/comparing_the_evolution_of_java_and_javascript.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/joe/2007/12/17/comparing_the_evolution_of_java_and_javascript.html</guid>
    <pubDate>Mon, 17 Dec 2007 13:19:28 GMT</pubDate>
  </item>
  
  <item>
    <title>JVM Usage Stats</title>
    <link>http://directwebremoting.org/blog/joe/2007/07/16/jvm_usage_stats.html</link>
    
      
        <description>
          &lt;p&gt;Often when you open an XML config file in a DTD/Schema aware editor, and you&#039;re connected to the internet, the editor will reach out over the net to fetch the DTD/XSD, which gives webmasters some interesting usage stats.&lt;/p&gt;

&lt;p&gt;I&#039;ve commented before on how you can use this technique to look at the &lt;a href=&#034;http://getahead.org/blog/joe/2006/11/28/dwr_usage_is_exploding.html&#034;&gt;big growth in DWR usage&lt;/a&gt;, but I noticed that you could also use it to suss out some JVM usage stats because when Eclipse etc come read the DTD they use the Java version number as their &lt;a href=&#034;http://en.wikipedia.org/wiki/User_agent&#034;&gt;User Agent&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Anyway, the numbers:&lt;/p&gt;

&lt;img src=&#034;http://getahead.org/images/jvm-usage.png&#034;/&gt;

&lt;p&gt;Caveat - there are about a million reasons why this is un-scientific. It may be interesting to some though.&lt;/p&gt;

&lt;p&gt;Aside: I wonder if Java should adopt the &#039;standard&#039; formatting for the User Agent string that is employed by all major browsers?&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/joe/2007/07/16/jvm_usage_stats.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/joe/2007/07/16/jvm_usage_stats.html</guid>
    <pubDate>Mon, 16 Jul 2007 09:14:53 GMT</pubDate>
  </item>
  
  <item>
    <title>Java 7 Idea: Extensible Strings</title>
    <link>http://directwebremoting.org/blog/joe/2007/04/10/java_7_idea_extensible_strings.html</link>
    
      
        <description>
          &lt;p&gt;In some ways it&#039;s a shame that java.lang.String is marked &#039;final&#039; in Java. If it wasn&#039;t final, you could inherit from java.lang.String to create strings that had some extra features, or you could extend with a marker interface to declare that a String has some property, for example it would be neat to be able to track if a String had been:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checked for dangerous characters from the web&lt;/li&gt;
&lt;li&gt;Internationalized&lt;/li&gt;
&lt;li&gt;Processed by some system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Allowing marker interfaces like this could lead to some nice extra type-checking:&lt;/p&gt;

&lt;pre&gt;
public SafeString checkForUnsafeCharacters(String s) {
  // do some checking and throw or create a SafeString
}

public void process(SafeString s) {
  // do something knowing that the developer can&#039;t forget
  // to check the string before it is passed in
}
&lt;/pre&gt;

&lt;p&gt;Marker interfaces on strings can be a handy way to declare that this string has some properly that normal strings don&#039;t.&lt;/p&gt;

&lt;p&gt;However there are at least 2 good reasons why java.lang.String is final:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Security: the system can hand out sensitive bits of read-only information without worrying that they will be altered&lt;/li&gt;

&lt;li&gt;Performance: immutable data is very useful in making thing thread-safe.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So is it possible to have the best of both worlds - to allow marker interfaces and additional properties without breaking assumptions about the immutability of the string itself. And, is this possible without breaking backwards compatibility?&lt;/p&gt;

&lt;p&gt;In Javas 1 to 6, java.lang.String is defined like this:&lt;/p&gt;

&lt;pre&gt;
public final class String {
  public int length() ...
  ... // other methods and properties
}
&lt;/pre&gt;

&lt;p&gt;I think we might be able to safely change this to:&lt;/p&gt;

&lt;pre&gt;
public class String {
  public final int length() ...
  ... // everything made final
}
&lt;/pre&gt;

&lt;p&gt;I don&#039;t think this breaks backwards compatibility anywhere because it mostly legalizes something that would previously have been a compile error, and the immutability of the core String is as unbroken as it was in Javas 1-6, although obviously the same guarantees could not be made about all extensions.&lt;/p&gt;

&lt;p&gt;Declaring finality in this way allows marker interfaces, which might in some cases allow developers to create APIs that enforce some properties on strings that might previously have been forgotten.&lt;/p&gt;

&lt;p&gt;Can anyone think of anything that I&#039;ve overlooked?&lt;/p&gt;

        </description>
      
      
    
    
    
    <comments>http://directwebremoting.org/blog/joe/2007/04/10/java_7_idea_extensible_strings.html#comments</comments>
    <guid isPermaLink="true">http://directwebremoting.org/blog/joe/2007/04/10/java_7_idea_extensible_strings.html</guid>
    <pubDate>Tue, 10 Apr 2007 11:34:51 GMT</pubDate>
  </item>
  
  </channel>
</rss>
