A program is a detailed set of instructions read by both a human and a machine. The computer reads only the code, while the human concentrates on the comments.
Tutorial Details:
Good style pertains to both parts of a program. Well-designed, well-written code not only makes effective use of the computer, it also contains careful constructed comments to help humans understand it. Well-designed, well-written code is a joy to debug, maintain, and enhance.
Good programming style begins with the effective organization of code. using a clear and consistent organization of the components of your program you make them more efficient, readable, and maintainable.
Program Organization
Good computer programs are organized much like good books. This can seen especially well with technical books, in which the structure is very clear.
People have been writing books for hundreds of years, and during that time they have discovered how to organize the material to efficiently present their ideas. Standards have emerged. For example, if I asked you when this book was copyrighted, you would turn to the title page. That's where the copyright notice is always located. The same goes for code. In fact, we can make the parallels quite explicit.
Table of Contents
Every technical book has a table of contents. It lists the location of all the chapters and major headings, and serves as a road map to the rest of the book.
A program should have a table of contents as well, listing the location of each function. This is difficult and tedious to produce by hand, however it can be produced quite easily by a number of readily available tools, as discussed later in this chapter.
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Style and Program Organization
View Tutorial: Style and Program Organization
Related
Tutorials:
Commercial applications with Java
Commercial applications with Java |
The battle of the container
frameworks: which should you use? - JavaWorld - January
1999
The battle of the container
frameworks: which should you use? - JavaWorld - January
1999 |
XML JavaBeans, Part 1 - JavaWorld February 1999
XML JavaBeans, Part 1 - JavaWorld February 1999 |
One, two, three,
or n tiers? - JavaWorld January 2000
One, two, three,
or n tiers? - JavaWorld January 2000 |
XML for the
absolute beginner - JavaWorld - April 1999
XML for the
absolute beginner - JavaWorld - April 1999 |
Leverage legacy systems
with a blend of XML, XSL, and Java - JavaWorld October 2000
Leverage legacy systems
with a blend of XML, XSL, and Java - JavaWorld October 2000 |
Jini's relevance emerges, Part
1
Jini's relevance emerges, Part
1 |
Build an interpreter in Java -- Implement the
execution engine (JavaWorld / July 1997 / by Chuck McManis)
Build an interpreter in Java -- Implement the
execution engine (JavaWorld / July 1997 / by Chuck McManis) |
Sun boosts
Sun boosts enterprise Java |
Unwrap the package statement's
potential
Unwrap the package statement's
potential |
Profiling the
profilers
Profiling the
profilers |
Good
introduction
Good
introduction |
Bug patrol
Bug patrol |
Excelling in
Excel with Java
Excelling in
Excel with Java |
JHttpTunnel
JHttpTunnel is the implementation of GNU httptunnel\'s protocol in pure Java. |
Java theory and practice: Kill bugs dead
Inspection tools like FindBugs provide a second layer of defense against common coding errors. |
Project Looking Glass: Its Architecture and Sneak Preview of the API
Bring a richer user experience to the desktop and to applications, through 3D windowing and visualization capabilities. This article covers Project Looking Glass' main features and API, its basic organization, and the functionality of important classes. |
Producing Enterprise Architecture:
A Conversation with Sun's Dan Hushon, Part Two In the final part of a two-part interview, Sun Microsystems' Dan Hushon talks about adaptive enterprise architectures, the market for developers, Java Centers of Excellence, and loosely coupled components. |
Accessing Database from servlets through JDBC!
Accessing Database from servlets through JDBC!
Accessing Access Database From Servlet
T his article shows you how to access database from servlets. Here I am assuming that you are using win95/98/2000 and running Java Web Server. For the sake of |
DB Visual Architect for Eclipse
DB Visual Architect for Eclipse (DBVA-EC) is a full featured Object Relational Mapping (ORM) plugin for Eclipse that provides the industry\'s best round-trip code engineering support with Java. |
|
|
|