Writing Comprehensible Code
Charles Forsythe <[email protected]> Thu, 14 Oct 2004 05:57:15 -0500
| Newsgroups | gmane.comp.java.advanced-servlets |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/