I have seen lots of code for lots of different things. Much of what I've seen has lots of redundancy and in some languages can actually slow the program down. This redundancy also has a tendancy to make code harder to read. Take for example the following two (they're not language specific, they just take attributes almost universal to any language (these "//" are comments):<br>
<pre><br>
function DoThis // creates a function called DoThis with n parameters<br>
if n = 0<br>
then print "apples"<br>
// print to the screen the word "apples"<br>
else<br>
if n = 1<br>
then print "oranges"<br>
// same as above except prints "oranges" instead<br>
if n = 2<br>
then print "pears"<br>
else<br>
if n = 3<br>
then print "peaches"<br>
end DoThis<br>
</pre><br>
the same code, simplified:<br>
<pre><br>
function DoThis // creates a function called DoThis with n parameters<br>
array x[] = {"apples","oranges","pears","peaches"} // initializes the array x<br>
print array[n] // prints the value of the array<br>
end DoThis<br>
</pre><br>
Now tell me which code is easier to read. <p>REH<br><a href=mailto:hawkdogg@crosswinds.net>hawkdogg@crosswinds.net</a><br><a href= by Linux</a><br>Learn Linux and Leave out the Windows
<pre><br>
function DoThis // creates a function called DoThis with n parameters<br>
if n = 0<br>
then print "apples"<br>
// print to the screen the word "apples"<br>
else<br>
if n = 1<br>
then print "oranges"<br>
// same as above except prints "oranges" instead<br>
if n = 2<br>
then print "pears"<br>
else<br>
if n = 3<br>
then print "peaches"<br>
end DoThis<br>
</pre><br>
the same code, simplified:<br>
<pre><br>
function DoThis // creates a function called DoThis with n parameters<br>
array x[] = {"apples","oranges","pears","peaches"} // initializes the array x<br>
print array[n] // prints the value of the array<br>
end DoThis<br>
</pre><br>
Now tell me which code is easier to read. <p>REH<br><a href=mailto:hawkdogg@crosswinds.net>hawkdogg@crosswinds.net</a><br><a href= by Linux</a><br>Learn Linux and Leave out the Windows