    <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  :: Assumptions</title>
        <link>https://members.accu.org/index.php/articles/862</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">CVu Journal Vol 11, #3 - Apr 1999</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/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/c132/">113</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;Assumptions</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 April 1999 13:15:30 +01:00 or Sat, 03 April 1999 13:15:30 +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="d0e22" id="d0e22"></a></h2>
</div>
<p>I was talking with someone at Apple who said he had once been
asked to write an article on writing programs for the disabled and
how this fits in with good programming in general, and he failed to
see the connection. The connection is an example of a very
fundamental thing: the avoidance of unnecessary assumptions.</p>
<p>When you program, you have to make assumptions, as the extreme
in avoiding assumptions is letting the user write the program
(something that this user too often has to resort to). Unless you
want to write an omnipotent program, you have to assume that your
program only needs to fulfil its specification. Whether that
specification is formally documented or exists only in your mind,
and whether or not you later amend it, is beside the point. The
assumption of what your program is required to do is a good thing,
as it allows you to know where you're going and start designing
it.</p>
<p>Some assumptions, though, are not so good. When writing code,
you can assume things nearly all the time that are nothing to do
with your specification, and thus limit your program in ways that
you did not realise. Or they could be in accordance with your
specification, but your specification may not live up to your
intentions as much as you think it does. These assumptions tend to
restrict the portability of your program in ways you do not expect,
and the ability to spot assumptions is a very valuable talent.
&quot;Portability&quot; can have a very wide meaning. Here are some examples
of assumptions that restrict portability:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Compiler portability: &quot;I think all <tt class="type">int</tt>s
are 16 bits wide.&quot; This can give you problems on many compilers,
and if you must assume it then perhaps it would be good to include
a preprocessor <tt class="function">sizeof()</tt> check so at least
the person trying to compile your code has some clue as to what's
wrong.</p>
</li>
<li>
<p>Scalability: &quot;I think this program will never deal with files so
big that you can't use a <tt class="type">long</tt> as a pointer.&quot;
On many architectures this will not scale beyond 2Gb; on some it
will be less depending on the size of a <tt class="type">long</tt>.
Assuming that you can fit a certain amount of information in memory
can also be flawed when dealing with huge amounts of data (many old
DOS disk manager programs that try to log the whole drive into
memory have problems with modern PC hard disks, let alone with
corporate servers).</p>
</li>
<li>
<p>API portability: &quot;I like drawing graphics with <tt class=
"function">line(x,y)</tt>.&quot; This is a vendor-specific runtime
library that will probably not work with other vendors or other
operating systems. Encapsulation can help.</p>
</li>
<li>
<p>Hardware portability: &quot;I think you can get 80 columns and 640
pixels on the screen.&quot; You may need to bear in mind other
possibilities unless your program has a very limited internal
domain.</p>
</li>
<li>
<p>Configuration portability: &quot;I think all my users have small
black fonts on a white background.&quot; If they have large yellow fonts
on a black background then some of your layout and colour
assumptions may fail and some parts of your program may be
inaccessible.</p>
</li>
<li>
<p>Skill portability: &quot;I think all my users have a PhD in Computer
Science and no objections to reading long manuals.&quot; How expert or
otherwise they have to be is something you have to decide.</p>
</li>
<li>
<p>Application domain portability: &quot;I think this menu will never
have so many items as to not fit on one screen.&quot; (Just try
enlarging the fonts.)</p>
</li>
<li>
<p>User interface portability: &quot;I think all my users like to point
and click and like the Microsoft look-and-feel.&quot; Simply porting
your program across different operating systems does not make it
intuitive in each, nor does it make it universally accessible.</p>
</li>
<li>
<p>Language portability: &quot;I think the length of my messages will
never change.&quot; This will not internationalise, but almost as bad is
setting an arbitrary limit on how much they can change.</p>
</li>
<li>
<p>Language culture portability: &quot;I think all users start reading
at the top left.&quot; If you want to internationalise your program then
you will find that this assumption can break down.</p>
</li>
</ul>
</div>
<p>And finally:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>&quot;I think the century never changes.&quot;</p>
</li>
</ul>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
