实用:源代码注释模板

Source Code Documentation Templates

 

Languages  

C C++ Delphi Java HTML Makefile Perl Shell SQL

Introduction  

 

Generic File Header  

Standard Web Based Description
Web CM File Header CM File Header

This header is designed to be placed at the head of each physical files and contains a selection of SCCS keywords together with organisational information (Project etc). These inform you of the files status, ownership and version number.

This particular example has C style of comments which you can change to the language specific commenting convention.

C  

Web-based UML Traditional Example Description
C Module C Module C Module C Module C module header. The traditional is based on the Unix man(2,3) format
C Function C Function C Function C Function Description placed at the head of each function within a C module

C++  

 

Web-based UML Traditional Example Description
Class Definition (.h) Class Definition (.h) Class Definition (.h) Class Definition (.h) Description of class definition
Class Implementation (.cpp/.C/.CC/.c++ ) Class Implementation (.cpp/.C/.CC/.c++ ) Class Implementation (.cpp/.C/.CC/.c++ ) Class Implementation (.cpp/.C/.CC/.c++ ) Description of the class implementation

Delphi  

 

File Type Description
None as yet working

Java  

 

  • Java programs are usually documented using javadoc which ships as part of the relevant Java sdk and third-party tools. The header files below have used the annotations of the javadoc tool.

    The javadoc tool collates all the comments from a series of .java files and produces and index page, giving an overview of all the packages, classes and their methods.

    Inner classes can be declared with a standard class definition. These are documented using the same template as an ordinary class.

    As above, each file uses the default configuration management file header , followed by the class header.

    I have included UML style documentation here for completeness, however, there is a UML documentation tool specifically for Java Code (and C++). The Together/J tool from Object International, a free version can be downloaded from their site.

Template Examples Description
Java Class File Example This is the documentation template for a Java class file. It can also be used for an inner classes.
Java Method Example Java Method documentation templates
Java Field Example Data fields in a class

HTML  

 

Object Description
HTML Header Standard HTML Document header including all the relevant META keywords.
HTML Footer Standard HTML Document footer including a selection of status keywords.

Makefile  

 

Makefile Example Description
Makefile Example Makefile template. This includes the CM header too and has a nice (IMHO) example.

Perl  

 

Type Description
Perl UML Package/Class This shows you how to write documentation using UML and is intended for OO Perl 5.
Perl UML Operation UML header for a perl function.

Shell  

 

Shell Programming Description
Shell Program  Derived from the Rabbit book (you know that I mean), a good general purpose header for shell programs.
Shell Function For those who like to write shell libraries of functions, a function header

SQL  

 

Databases Description
SQL Script Files  Much as above but with sql type comments
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值