Journal Articles

CVu Journal Vol 12, #1 - Jan 2000
Browse in : All > Journals > CVu > 121 (30)

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. 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/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Members' Experiences

Author: Administrator

Date: 04 January 2000 13:15:34 +00:00 or Tue, 04 January 2000 13:15:34 +00:00

Summary: 

Body: 

Doc++ report from by Silas S. Brown

Doc++ is a program for generating documentation from C, C++ and Java code. Its use is similar to Javadoc, and it can create both HTML and TeX (for typesetting), like Web. It runs on most Unix systems, and can be compiled under Win32 with the GNU compiler. It is available for download from http://www.imaginator.com/doc++ and is included as a package in most Linux and BSD distributions.

Writing your source code with Doc++ in mind is simply a matter of inserting extra comments before the things you need to document. Doc++ comments are distinguished from other comments in that they begin with three slashes (///), or /** (/** is usually on a line of its own, and then the first line of the comment is treated as a summary). Insert these before any class, method, global function, variable, #define, enumeration and so on that you need to document, and in the comment put what you want to say about them.

Hierarchy is handled automatically, but if you need to group a few things together then you can create a Doc++ "scope" (which need not have any bearing on the program's scopes) with //@{ and //@} (or /*@{*/ and /*@}*/), and attach a Doc++ comment to it.

You can use a subset of HTML or TeX in the comments, and if you use HTML then it will be converted to TeX as necessary and vice versa. The HTML tags supported are P, EM, I, B, PRE, DL/DD/DT, UL/LI and LL/LI (other tags such as TT might have been useful, but perhaps they will be supported later). You can (if you need to) use TeX equations, and Doc++ will try to convert them to images for the HTML. You can also use Javadoc's tags @param, @return, @author and @see as in the following example:

@param x The X co-ordinate
@param y The Y co-ordinate
@return The distance from the origin
@author Me
@see SomeClass SomeIdentifier

One thing to bear in mind is that very occasionally there is ambiguity in what the Doc++ comments are referring to, and you may need to re-write the code slightly. For example, if a Doc++ comment were attached to

typedef struct { ... } x;

then it would be ambiguous whether it is referring to the struct or to x.

Doc++ source will of course compile as-is (it does not need to be "tangled" in the manner of the Web system), and generating the documentation is a matter of running doc++ with the right parameters. To try it out, I added some Doc++ comments to my access gateway source (and converted some of the existing comments into Doc++ comments), and tried converting it to HTML.

Unfortunately, the current version doesn't handle everything, especially if you specify -A (document All, i.e. including things that don't have Doc++ comments), in which case it gets confused by C++ files, and sometimes links to the sources instead of HTML. Best results are obtained by not using -A, and processing *.h before *.c++. Multiple /// lines don't always work well, overloaded functions are not handled (only the last function gets documented), and the anchors in General.html don't exist. Of course, this may all be fixed later.

If you have a Java-enabled browser, you can use an applet to view the class hierarchy. This could be useful if you prefer that way of working, but fortunately it is not a requirement.

The TeX output is well thought-out, although it is prone to wasting paper if you have a lot of identifiers with very little documentation (since at least one page is allocated to each). You have to run Latex in batch mode, otherwise it will stop you too often. Sometimes it outputs a mess. The contents are in the order of the source files; there's no way to sort it alphabetically but you can request the generation of an index. The "generate a complete source listing" option doesn't seem to work yet.

Overall, Doc++ shows promise, but at present it's probably best not to rely on it for showing your code to others in professional situations without checking its output first. As with other documentation systems, it is easier to begin a project with Doc++ in mind than it is to add it later.

Experiences Wanted

Semantic Designs

I wonder if anyone reading this has any experience of this company's products. See http://www.semdesigns.com/Products/

They have a couple of products that look useful to the professional software shop. One is DMS. a re-engineering toolkit can be told to search for language-specific patterns (such as pointer declarations) and replace them with other language constructs. It doesn't get confused about "*" as multiply, because it isn't editing the source text; rather, it is editing a parse tree, just like the one a C compiler builds.

The other tool searches code in several popular commercial languages for clone or near clone code, thus allowing you to clean up code and making it more maintainable in the future.

If you have experience of either of these products or know of competitive products that do something similar please write them up.

Garbage Collection

There are several commercial tools to provide a degree of Garbage Collection for both C and C++. If memory serves me correctly, there is also at least one non-commercial product in this field. If you have experience of products in this area, please write them up and share them.

'Extensions' to the Standard C++ Library

So you looked in the Standard C++ Library and it came up dry. You wanted a hash-map, or a better smart pointer or… And you feel that it really should have been in the Standard C++ Library. Well quite a few of those responsible for the SC++L would not argue with you. However they do not want to destabilise their work by officially developing extensions for next time round. Anyway many of us know that the contents of libraries should be based on hard won experience and not just thrown together on the spur of the moment (noticed how the Java libraries are sprouting like weeds after some warm rain?).

If you have access to the Web, go and check www.boost.org. You might be pleasantly surprised. Whatever your reaction, please take a few minutes (OK a little longer than that) to share your experience with your fellow members.

A New Matrix Library

The following is an announcement that was posted to comp.lang.c++.moderated. If it is in your area of interest/expertise could you have a look at it and report back? Thanks.

Major New Release of the Matrix Template Library (Version 2.1.2-14)
Newly Supported Compilers:
Microsoft Visual C++ 6.0
Metrowerks CodeWarrior Pro 5.0 (both Mac and x86)

After much blood, sweat, and tears we are happy to announce the port of MTL to Visual C++ as well as to CodeWarrior. The ports for both compilers have passed the full MTL test suite (all 354,432 tests). We have also ironed out many of the smaller issues with the SGI, KCC, and g++ compilers (including an update for g++ 2.95). The new version of MTL is available for download at: http://lsc.nd.edu/research/mtl/download.php3

Thanks to Valient Gough we have added lu_solve() and lu_inverse() routines to make it more convenient to use lu_factor() to solve systems of equations. Thanks to the rest of you for sending in bug reports, bug fixes, and suggestions!

We encourage MTL users who have written algorithms, data structures or utility functions that might be useful to others to send your code in. It is all about code reuse!

There has been a couple small interface changes that are listed on the web page under "What's New".

Enjoy!

Jeremy Siek & Andrew Lumsdaine

What Do You Want to Know About?

Well the title about says it. Perhaps you can help involve other members in this column by writing a brief requirement for information about a software tool. Of course I cannot promise an answer but we can but try.

Notes: 

More fields may be available via dynamicdata ..