    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: In Java I Wish I Could...</title>
        <link>https://members.accu.org/index.php/articles/2397</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Programming Topics + CVu Journal Vol 29, #3 - July 2017</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c65/">Programming</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c375/">293</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c65-375/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c65+375/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;In Java I Wish I Could...</h1>
<p><strong>Author:</strong>&nbsp;Bob Schmidt</p>
<p>
<strong>Date:</strong> 06 July 2017 18:01:55 +01:00 or Thu, 06 July 2017 18:01:55 +01:00</p>
<p><strong>Summary:</strong>&nbsp;Paul Grenyer wishes for features of one language in another.</p>
<p><strong>Body:</strong>&nbsp;<p>I started programming in BBC Basic on an Acorn Electron in 1985. I then went on to learn and use commercially C, C++ (thereâ€™s no such language as C/C++), C# and Java. When I was a C++ programmer, I looked down on Java with its virtual machine, just in time compiling and garbage collector. When I became a Java programmer, I completely fell in love with it and its tool chain. Not so with Ruby, especially its tool chain, a lack of a static type system and lack of interfaces.</p>

<p>However, there are some fantastic features in the language and a few of them I wish I could use in Java. For example, in Ruby, you can put conditional statements after expressions, for example:</p>

<pre class="programlisting">
  return '1' if a == 1
  return '2' if a == 2</pre>
  
<p>whereas in Java youâ€™d have to write:</p>

<pre class="programlisting">
  if (a == 1)
   return &quot;1&quot;;
  if (a == 2)
    return &quot;2&quot;;</pre>

<p>which is more verbose and less expressive.</p>

<p>Ruby also has the <code>unless</code> keyword, which Java lacks, so in Ruby you can do this:</p>

<pre class="programlisting">
  return @colour unless @colour.nil?</pre>
  
<p>The example shows off another feature in Ruby. To test for <code>nil</code> in Ruby you can call .<code>nil?</code> on any object, whereas the equivalent null check in Java is more verbose:</p>

<pre class="programlisting">
  if (colour != null)
    return colour;</pre>
	
<p>I could go on, but Iâ€™ll leave that for a later piece in the series. These features of Ruby may only be, in the main, syntactic sugar, but they are the ones I miss most when Iâ€™m developing in Java.</p>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
