    <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  :: Letter to the Editor</title>
        <link>https://members.accu.org/index.php/articles/266</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">Letters to the Editor + Overload Journal #66 - Apr 2005</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/c184/">Journal Columns</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c186/">LettersEditor</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/c78/">Overload</a>

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

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

                    -                        <a href="https://members.accu.org/index.php/articles/c186+146/">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;Letter to the Editor</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 12 April 2005 18:05:25 +01:00 or Tue, 12 April 2005 18:05:25 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="section" lang="en">
<div class="titlepage">
<h2><a name="d0e18" id="d0e18"></a></h2>
</div>
<p>Hi Alan,</p>
<p>I just want to thank you for your great editorial in the
February issue of Overload (&quot;'They' Have Their Reasons&quot;). As you
write: &quot;<span class="quote">If you can find and talk to them you
will find that &quot;they&quot; are normal human beings trying to achieve
reasonable goals in reasonable ways.</span>&quot; Deep inside, I know
this to be true, but it's still good to be reminded of it,
especially if you deal with someone who appears &quot;unreasonable&quot;.
They are probably reasonable, from <span class=
"emphasis"><em>their</em></span> perspective.</p>
<p>What inspired me to write this is that I've lately been
discussing with some people in the PHP community, and &quot;they&quot; don't
appear to appreciate the value of higher abstractions (preferring a
&quot;simple language&quot;, even though this may lead to complex or verbose
code). Or even stronger type-checking, I may add. In C/C++/Java, we
may write:</p>
<pre class="programlisting">
void f(int a, string b, vector c)
</pre>
<p>and we know it takes an <tt class="type">int</tt>, <tt class=
"type">string</tt> and <tt class="type">vector</tt>, no more, nor
less, and returns nothing. In PHP, with the following:</p>
<pre class="programlisting">
function f($a, $b, $c)
</pre>
<p>we know hardly anything: We know that it takes (at least) three
arguments - but it may take more - and we know nothing about their
type, and any return type (and it may return different types, or
nothing at all, depending on its run-time path through the
function... All variables in PHP are like variants - they can take
on any type). I can't for the life of me understand how someone
finds writing code like this more &quot;productive&quot; and &quot;easier&quot;.
Myself, I've spent way too much time chasing stupid type-related
bugs in PHP, that could have trivially been checked by the
compiler/runtime. Flexibility to do what? Make type-related errors?
Sorry, if I really want to do that, I want to say so explicitly -
by overriding the type-system with a cast.</p>
<p>My company makes web applications for other companies, and we're
using PHP, and I've been using it professionally for a couple of
years, so it's not like I'm a PHP beginner, but still the above
baffles me. I like not having to wait for compilation with PHP, but
if I could choose stronger type-checking, my answer would be YES.
The kind of absent type-checking above tends to encourage sloppy
coding, and you have to explicitly check for types inside the
function, if you want to do so (it's similar to having to
explicitly check for return codes, which is often not done... At
least PHP 5 does have exceptions). You still can't enforce a
certain return type, though. Really, if I wanted a particular
parameter to be a &quot;variant&quot;, I'd specify that (and if the types it
could have were known, I'd enumerate them, and if not, use
something like <tt class="classname">boost::any</tt>). It adds
information and explicitness to the code, and should make it easier
to understand. Yet, it appears the majority of PHP developers don't
want it (from what I've read on various mailing lists and
newsgroups). Why? Have you got any idea?</p>
<p>Regards, Terje</p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
