Re: SPAM: Writing Comprehensible Code

[email protected] Fri, 15 Oct 2004 09:16:45 +1000
Newsgroups gmane.comp.java.advanced-servlets
Message-ID <OFD8E43CE3.8F81488E-ONCA256F2D.007E43F1-CA256F2D.0080B89D@westpac.com.au>


One of the things I would have loved is a limited version of operator 
overload. I can understand why the original Java inventors added "+" for 
Strings (who wants to write concat() all the time) but allowing it for any 
class would lead to the abuses frequently seen in C++. However extending 
the Number class or more flexibly, implementing a Numeric interface, to 
allow operator overload would be nice. While the interface version could 
be abused fairly easily, extending Number should be fairly controllable. 
Autoboxing should reduce my desire for operator overload but I strongly 
suspect I will continue to miss it.

BTW even though I am not an Xtreme programmer I too believe that the code 
is the ultimate documentation. The number of times I've seen the doco 
missing, out of date or just plain wrong (and that includes inline 
comments and javadoc) is incredible. Maintenance programmers will 
generally find more often than not that the doco is useless.

Michael Rutherfurd

Charles Forsythe <[email protected]> wrote on 14/10/2004 08:57:15 PM:

> 
> luca wrote:
> 
> >for eXtreme Programmers code is the ultimate documentation,
> >so it does have to be comprehensible
> >
> I guess I should have included a :-)  -- the comment about "we wouldn't 
> call it code" is a "geek humor" standard along the lines of "BASIC is a 
> bug with syntax," or "Strong typing is for people with weak memories."
> 
> One of the design goals of COBOL was that the statements resemble plain 
> English for the very reason of having the code be its own 
> documentation.  So, instead of:
> 
>     foo += bar
> 
> You'd have:
> 
>     ADD BAR TO FOO
> 
> (Or something like that.)  Java code that follows common naming and 
> formatting conventions is almost always comprehensible.  It annoys me 
> when people compare Java to C++ in this regard.  Consider the "foo += 
> bar" expression above; you don't have to look far to determine _exactly_ 

> what statement does.  In C++, it could literally do anything, and 
> finding out what could take a considerable effort.
> 
> -- Charles

WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments.

This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision.

Westpac is a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency.

Westpac Institutional Bank is a division of Westpac Banking Corporation ABN is 33 007 457 141.

[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

Before posting a question, try to find your answer here: 
<http://www.egroups.com/links/advanced-servlets>
Announcements should go to: [email protected]
To Post a message, send it to: [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/advanced-servlets/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/