From fd0570667f9fdb2c95a10c066afe7e00fd81637a Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Fri, 21 Jul 2006 14:48:20 +0000 Subject: [PATCH] overall documentation check: made sure there's no duplication of information and validated html [SVN r34652] --- lib_guide.htm | 1519 +++++++++++++++++++++++++++------------------ license_info.html | 40 +- 2 files changed, 949 insertions(+), 610 deletions(-) diff --git a/lib_guide.htm b/lib_guide.htm index 2eb8784..f258260 100644 --- a/lib_guide.htm +++ b/lib_guide.htm @@ -1,612 +1,931 @@ + - - Boost Library Requirements and Guidelines - - - - - - - - - - - - - - - + + + Boost Library Requirements and Guidelines + + + + + + + + +
boost.png (6897 bytes)HomeLibrariesPeopleFAQMore
+ + + + + + + + +
+ boost.png (6897 bytes) + + Home + + + Libraries + + People + + + FAQ + + More +
+

+ + Boost Library Requirements and Guidelines +

+

+ Introduction
+ Requirements
+     License requirements
+     Portability requirements
+ +     Ownership
+ Guidelines
+     Design and + programming
+     Directory structure and + filenames
+     Naming + consistency
+ +     Documentation
+ Rationale
+     Exception-specification rationale
+     Naming conventions rationale
+     Source code fonts + rationale
+ +     Tabs rationale
+     ECMAScript/JavaScript + rationale
+     Rationale + rationale
+     Acknowledgements + rationale +

+ +

+ Introduction +

+

+ This page describes requirements and guidelines for the content of a + library submitted to Boost. +

+

+ See the Boost Library Submission + Process page for a description of the process involved. +

+ +

+ Requirements +

+

+ To avoid the frustration and wasted time of a proposed library being + rejected, it must meets these requirements: +

+ +

+ There's no requirement that an author read the mailing list for a time + before making a submission. It has been noted, however, that submissions + which begin "I just started to read this mailing list ..." seem to fail, + often embarrassingly. +

+

+ License requirements +

+

+ The preferred way to meet the license requirements is to use the Boost Software License. See license information. If for any reason you do not + intend to use the Boost Software License, please discuss the issues on the + Boost developers mailing list first. +

+ +

+ The license requirements: +

+ +

+ Portability requirements +

+ +

+ Since there is no absolute way to prove portability, many boost submissions + demonstrate practical portability by compiling and executing correctly with + two different C++ compilers, often under different operating systems.  + + Otherwise reviewers may disbelieve that porting is in fact practical. +

+

+ Ownership +

+

+ Are you sure you own the library you are thinking of + submitting?   "How to Copyright Software" by MJ Salone, Nolo + Press, 1990 says: +

+ +
+

+ Doing work on your own time that is very similar to programming you do + for your employer on company time can raise nasty legal problems.  + In this situation, it's best to get a written release from your employer + in advance. +

+
+

+ Place a copyright notice in all the important files you submit. Boost won't + accept libraries without clear copyright information. +

+ +

+ Guidelines +

+

+ Please use these guidelines as a checklist for preparing the content a + library submission.  Not every guideline applies to every library, but + a reasonable effort to comply is expected. +

+

+ Design and + Programming + +

+ + + + + + + + + + + + + + + + + +

+ Directory + Structure and Filenames +

+ + +
+

+ Boost standard sub-directory names + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Sub-directory + + Contents + + + Required +
+ build + + + Library build files such as a Jamfile. + + If any build files. +
+ + doc + + Documentation (HTML) files. + + If several doc files. +
+ example + + Sample program files. + + If several sample files. +
+ src + + Source files which must be compiled to build the library.  + + If any source files. +
+ test + + + Regression or other test programs or scripts. + + If several test files. +
-

Boost Library Requirements and Guidelines

-

Introduction
- Requirements
-     License requirements
-     Portability requirements
-     Ownership
- Guidelines
-     Design and programming
-     Directory structure and - filenames
-     Naming consistency
-     Documentation
- Rationale
-     Exception-specification - rationale
-     Naming conventions rationale
-     Source code fonts rationale
-     Tabs rationale
-     ECMAScript/JavaScript rationale
-     Rationale rationale
-     Acknowledgements rationale

-

Introduction

-

This page describes requirements and guidelines for the content of - a library submitted to Boost.

-

See the Boost Library Submission - Process page for a description of the process involved.

-

Requirements

-

To avoid the frustration and wasted time of a proposed library being rejected, - it must meets these requirements:

- -

There's no requirement that an author read the mailing list for a time before - making a submission. It has been noted, however, that submissions which begin - "I just started to read this mailing list ..." seem to fail, often - embarrassingly.

-

License requirements

-

The preferred way to meet the license requirements is to use the - Boost Software License. See license information. - If for any reason you do not intend to use the Boost Software License, please - discuss the issues on the Boost developers - mailing list first.

-

The license requirements:

- -

Portability requirements

- -

Since there is no absolute way to prove portability, many boost - submissions demonstrate practical portability by compiling and executing - correctly with two different C++ compilers, often under different operating - systems.  Otherwise reviewers may disbelieve that porting is in fact - practical.

-

Ownership

-

Are you sure you own the library you are thinking of - submitting?   "How to Copyright Software" by MJ Salone, Nolo Press, - 1990 says:

-
-

Doing work on your own time that is very similar to programming - you do for your employer on company time can raise nasty legal problems.  - In this situation, it's best to get a written release from your employer in - advance.

-
-

Place a copyright notice in all the important files you submit. - Boost won't accept libraries without clear copyright information.

-

Guidelines

-

Please use these guidelines as a checklist for preparing the - content a library submission.  Not every guideline applies to every - library, but a reasonable effort to comply is expected.

-

Design and Programming

- - - - - - - - - - - - - - - -
+

+ Redirection -

Include a comment based on the following template, substituting -appropriate text for the italicized portion: +

+

+ The primary directory should always contain a file named index.html (or + index.htm). Authors have requested this so that they can publish URL's in + the form http://www.boost.org/libs/lib-name with the assurance a + documentation reorganization won't invalidate the URL. Boost's internal + tools are also simplified by knowing that a library's documentation is + always reachable via the simplified URL. +

+

+ If the documentation is in a doc sub-directory, the primary directory + index.html file should just do an automatic redirection to the doc + subdirectory: +

+
-
// Copyright 2004 Jane Coder.
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- - Please leave an empty line before and after the copyright and license comments. - It is fine if the copyright and license messages are on different lines, but - there should be no other intervening text. Do not include "All rights reserved" - in the copyright message.
-
- See license information page for more - information about the Boost Software License.
-
- Note that developers should not include a copy of LICENSE_1_0.txt in - their libraries; Boost distributions already include a copy in the Boost root - directory.
-   -
  • - A comment line referencing your library on the Boost web site. For example:
    -
    - //  See http://www.boost.org/libs/foo for library home page.
    -
    - where foo is the directory name (see below) for your library. As - well as aiding users who come across a Boost file detached from its - documentation, some of Boost's automatic tools depend on this comment to - identify which library header files belong to.
  • - - - - -

    Directory Structure and Filenames

    - -
    -

    Boost standard sub-directory names

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Sub-directoryContentsRequired
    buildLibrary build files such as a Jamfile.If any build files.
    docDocumentation (HTML) files.If several doc files.
    exampleSample program files.If several sample files.
    srcSource files which must be compiled to build the library. If any source files.
    testRegression or other test programs or scripts.If several test files.
    -
    -

    Redirection

    -

    The primary directory should always contain a file named index.html (or - index.htm). Authors have requested this so that they can publish URL's in the - form http://www.boost.org/libs/lib-name with the assurance a - documentation reorganization won't invalidate the URL. Boost's internal tools - are also simplified by knowing that a library's documentation is always - reachable via the simplified URL.

    -

    If the documentation is in a doc sub-directory, the primary directory - index.html file should just do an automatic redirection to the doc - subdirectory:

    -
    -
    <html>
    +      
    +<html>
     <head>
     <meta http-equiv="refresh" content="0; URL=doc/index.html">
     </head>
     <body>
     Automatic redirection failed, please go to
     <a href="doc/index.html">doc/index.html</a>
    +
     </body>
    -</html>
    -
    -

    Naming consistency

    -

    As library developers and users have gained experience with Boost, the - following consistent naming approach has come to be viewed as very helpful, - particularly for larger libraries that need their own header subdirectories - and namespaces.

    -

    Here is how it works. The library is given a name that describes the contents - of the library. Cryptic abbreviations are strongly discouraged. Following the - practice of the C++ Standard Library, names are usually singular rather than - plural. For example, a library dealing with file systems might chose the - name "filesystem", but not "filesystems", "fs" or "nicecode".

    - - -

    When documenting Boost libraries, follow these conventions (see also the following section of this document): -

    -

    Here are a few examples of how to apply these conventions: -

    - -

    Documentation

    -

    Even the simplest library needs some documentation; the amount should be - proportional to the need.  The documentation should assume the readers - have a basic knowledge of C++, but are not necessarily experts.

    -

    The format for documentation should be HTML, and should not require an advanced - browser or server-side extensions. Style sheets are acceptable. - ECMAScript/JavaScript is not acceptable. The documentation entry point should - always be a file named index.html or index.htm; see Redirection.

    -

    There is no single right way to do documentation. HTML documentation is often - organized quite differently from traditional printed documents. Task-oriented - styles differ from reference oriented styles. In the end, it comes down to the - question: Is the documentation sufficient for the mythical "average" C++ - programmer to use the library successfully?

    -

    Appropriate topics for documentation often include: -

    -

    If you need more help with how to write documentation you can check out the - article on Writing Documentation for Boost.

    -

    Rationale

    -

    Rationale for some of the requirements and guidelines follows.

    -
    -

    Exception-specification rationale

    -

    Exception specifications [ISO 15.4] are sometimes coded to indicate what - exceptions may be thrown, or because the programmer hopes they will improved - performance.  But consider the following member from a smart pointer:

    -
        T& operator*() const throw()  { return *ptr; }
    -

    This function calls no other functions; it only manipulates fundamental data - types like pointers Therefore, no runtime behavior of the - exception-specification can ever be invoked.  The function is completely - exposed to the compiler; indeed it is declared inline Therefore, a smart - compiler can easily deduce that the functions are incapable of throwing - exceptions, and make the same optimizations it would have made based on the - empty exception-specification. A "dumb" compiler, however, may make all kinds - of pessimizations.

    -

    For example, some compilers turn off inlining if there is an - exception-specification.  Some compilers add try/catch blocks. Such - pessimizations can be a performance disaster which makes the code unusable in - practical applications.

    -

    Although initially appealing, an exception-specification tends to have - consequences that require very careful thought to understand. The - biggest problem with exception-specifications is that programmers use them as - though they have the effect the programmer would like, instead of the effect - they actually have.

    -

    A non-inline function is the one place a "throws nothing" - exception-specification may have some benefit with some compilers.

    -
    -

    Naming conventions rationale

    -

    The C++ standard committee's Library Working Group discussed this issue in - detail, and over a long period of time. The discussion was repeated again in - early boost postings. A short summary:

    - -
    -

    Source code fonts rationale

    -

    Dave Abrahams comments: An important purpose (I daresay the primary purpose) of - source code is communication: the documentation of intent. This is a doubly - important goal for boost, I think. Using a fixed-width font allows us to - communicate with more people, in more ways (diagrams are possible) right there - in the source. Code written for fixed-width fonts using spaces will read - reasonably well when viewed with a variable-width font, and as far as I can - tell every editor supporting variable-width fonts also supports fixed width. I - don't think the converse is true.

    -
    -

    Tabs rationale

    -

    Tabs are banned because of the practical problems caused by tabs in - multi-developer projects like Boost, rather than any dislike in principle. See - mailing list archives. Problems include maintenance of a single source - file by programmers using tabs and programmers using spaces, and the difficulty - of enforcing a consistent tab policy other than just "no tabs". Discussions - concluded that Boost files should either all use tabs, or all use spaces, and - thus the decision to stick with spaces.

    -
    -

    ECMAScript/JavaScript rationale

    -

    Before the 1.29.0 release, two Boost libraries added ECMAScript/JavaScript - documentation. Controversy followed (see mailing - list archives), and the developers were asked to remove the - ECMAScript/JavaScript. Reasons given for banning included:

    - -
    -

    Rationale rationale

    -

    Rationale is defined as "The fundamental reasons for something; basis" by the - American Heritage Dictionary.

    -

    Beman Dawes comments:  Failure to supply contemporaneous rationale for - design decisions is a major defect in many software projects. Lack of accurate - rationale causes issues to be revisited endlessly, causes maintenance bugs when - a maintainer changes something without realizing it was done a certain way for - some purpose, and shortens the useful lifetime of software.

    -

    Rationale is fairly easy to provide at the time decisions are made, but very - hard to accurately recover even a short time later.

    -
    -

    Acknowledgements rationale

    -

    As a library matures, it almost always accumulates improvements suggested to - the authors by other boost members.  It is a part of the culture of - boost.org to acknowledge such contributions, identifying the person making the - suggestion.  Major contributions are usually acknowledged in the - documentation, while minor fixes are often mentioned in comments within the - code itself.

    -
    -

    Revised - 08 June, 2006

    -

    - © Copyright Beman Dawes 2003.

    -

    Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at www.boost.org/LICENSE_1_0.txt) +</html> + +

    +

    + Naming consistency +

    +

    + As library developers and users have gained experience with Boost, the + following consistent naming approach has come to be viewed as very helpful, + particularly for larger libraries that need their own header subdirectories + and namespaces.

    - - \ No newline at end of file + +

    + Here is how it works. The library is given a name that describes the + contents of the library. Cryptic abbreviations are strongly discouraged. + Following the practice of the C++ Standard Library, names are usually + singular rather than plural. For example, a library dealing with file + systems might chose the name "filesystem", but not "filesystems", "fs" or + "nicecode". +

    + +

    + When documenting Boost libraries, follow these conventions (see also the + following section of this document): +

    + +

    + Here are a few examples of how to apply these conventions: +

    + +

    + Documentation +

    +

    + Even the simplest library needs some documentation; the amount should be + proportional to the need.  The documentation should assume the readers + have a basic knowledge of C++, but are not necessarily experts. +

    + +

    + The format for documentation should be HTML, and should not require an + advanced browser or server-side extensions. Style sheets are acceptable. + ECMAScript/JavaScript is not acceptable. The documentation entry point + should always be a file named index.html or index.htm; see Redirection. +

    +

    + There is no single right way to do documentation. HTML documentation is + often organized quite differently from traditional printed documents. + Task-oriented styles differ from reference oriented styles. In the end, it + comes down to the question: Is the documentation sufficient for the + mythical "average" C++ programmer to use the library successfully? +

    +

    + Appropriate topics for documentation often include: +

    + + +

    + If you need more help with how to write documentation you can check out the + article on Writing Documentation for + Boost. +

    + +

    + Rationale +

    +

    + Rationale for some of the requirements and guidelines follows. +

    +
    +

    + Exception-specification rationale +

    + +

    + Exception specifications [ISO 15.4] are sometimes coded to indicate what + exceptions may be thrown, or because the programmer hopes they will + improved performance.  But consider the following member from a smart + pointer: +

    +
    +    T& operator*() const throw()  { return *ptr; }
    +
    +

    + This function calls no other functions; it only manipulates fundamental + data types like pointers Therefore, no runtime behavior of the + exception-specification can ever be invoked.  The function is + completely exposed to the compiler; indeed it is declared inline Therefore, + a smart compiler can easily deduce that the functions are incapable of + throwing exceptions, and make the same optimizations it would have made + based on the empty exception-specification. A "dumb" compiler, however, may + make all kinds of pessimizations. +

    + +

    + For example, some compilers turn off inlining if there is an + exception-specification.  Some compilers add try/catch blocks. Such + pessimizations can be a performance disaster which makes the code unusable + in practical applications. +

    +

    + Although initially appealing, an exception-specification tends to have + consequences that require very careful thought to understand. The + biggest problem with exception-specifications is that programmers use them + as though they have the effect the programmer would like, instead of the + effect they actually have. +

    +

    + + A non-inline function is the one place a "throws nothing" + exception-specification may have some benefit with some compilers. +

    +
    +

    + Naming conventions rationale +

    +

    + The C++ standard committee's Library Working Group discussed this issue in + detail, and over a long period of time. The discussion was repeated again + in early boost postings. A short summary: +

    + + +
    +

    + + Source code fonts rationale +

    +

    + Dave Abrahams comments: An important purpose (I daresay the primary + purpose) of source code is communication: the documentation of intent. This + is a doubly important goal for boost, I think. Using a fixed-width font + allows us to communicate with more people, in more ways (diagrams are + possible) right there in the source. Code written for fixed-width fonts + using spaces will read reasonably well when viewed with a variable-width + font, and as far as I can tell every editor supporting variable-width fonts + also supports fixed width. I don't think the converse is true. +

    +
    +

    + Tabs rationale +

    + +

    + Tabs are banned because of the practical problems caused by tabs in + multi-developer projects like Boost, rather than any dislike in principle. + See mailing list archives. Problems + include maintenance of a single source file by programmers using tabs and + programmers using spaces, and the difficulty of enforcing a consistent tab + policy other than just "no tabs". Discussions concluded that Boost files + should either all use tabs, or all use spaces, and thus the decision to + stick with spaces. +

    +
    +

    + ECMAScript/JavaScript rationale +

    + +

    + Before the 1.29.0 release, two Boost libraries added ECMAScript/JavaScript + documentation. Controversy followed (see mailing list archives), and the developers + were asked to remove the ECMAScript/JavaScript. Reasons given for banning + included: +

    + +
    +

    + Rationale + rationale + +

    +

    + Rationale is defined as "The fundamental reasons for something; basis" by + the American Heritage Dictionary. +

    +

    + Beman Dawes comments:  Failure to supply contemporaneous rationale for + design decisions is a major defect in many software projects. Lack of + accurate rationale causes issues to be revisited endlessly, causes + maintenance bugs when a maintainer changes something without realizing it + was done a certain way for some purpose, and shortens the useful lifetime + of software. +

    +

    + Rationale is fairly easy to provide at the time decisions are made, but + very hard to accurately recover even a short time later. +

    + +
    +

    + Acknowledgements + rationale +

    +

    + As a library matures, it almost always accumulates improvements suggested + to the authors by other boost members.  It is a part of the culture of + boost.org to acknowledge such contributions, identifying the person making + the suggestion.  Major contributions are usually acknowledged in the + documentation, while minor fixes are often mentioned in comments within the + code itself. +

    + +
    +

    + Revised + + 04 November, 2003 +

    +

    + © Copyright Beman Dawes 2003. +

    + +

    + Distributed under the Boost Software License, Version 1.0. (See + accompanying file LICENSE_1_0.txt or copy + at www.boost.org/LICENSE_1_0.txt) +

    + + diff --git a/license_info.html b/license_info.html index a657005..15701dd 100644 --- a/license_info.html +++ b/license_info.html @@ -1,16 +1,18 @@ + - + Boost Software License Background - +
    @@ -139,13 +141,21 @@ license.

    How should Boost programmers apply the license to source and header files?

    -

    Include a comment based on the following template, substituting +

    Add a comment based on the following template, substituting appropriate text for the italicized portion: - -

    // Copyright 2004 Jane Coder.
    -// Distributed under the Boost Software License, Version 1.0. (See accompanying
    -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
    +
    +
    +
    +//          Copyright Joe Coder 2004 - 2006.
    +// Distributed under the Boost Software License, Version 1.0.
    +//    (See accompanying file LICENSE_1_0.txt or copy at
    +//          http://www.boost.org/LICENSE_1_0.txt)
     
    +
    +Please leave an empty line before and after the above comment block. +It is fine if the copyright and license messages are not on different lines; in +no case there should be other intervening text. Do not include +"All rights reserved" anywhere.

    Other ways of licensing source files have been considered, but some of them turned out to unintentionally nullify legal elements of the @@ -154,6 +164,17 @@ corporate legal departments evaluate the boost distribution. Creativity in license reference language is strongly discouraged, but judicious changes in the use of whitespace are fine. +

    How should the license be applied to documentation files, instead?

    + +

    Very similarly to the way it is applied to source files: the user should +see the very same text indicated in the template above, with the only difference +that both the local and the web copy of LICENSE_1_0.txt should be linked to. +Refer to the HTML source codee of this document in case of doubt. + +

    Note that the location of the local LICENSE_1_0.txt needs to be indicated +relatively to the position of your documentation file +(../LICENSE_1_0.txt, ../../LICENSE_1_0.txt etc.)

    +

    How is the Boost license different from the GNU General Public License (GPL)?

    @@ -213,7 +234,6 @@ shouldn't be in the BSD license."

    Do I have to copyright/license trivial files? -

    Even a test file that just contains an empty main() should have a copyright. Files without copyrights make corporate lawyers nervous, and that's a barrier to adoption. The more of Boost @@ -247,7 +267,7 @@ contributed analysis of Boost issues and drafts of various legal documents. Boost members reviewed drafts of the license. Beman Dawes wrote this web page.


    Revised -08 June, 2006

    +27 August, 2004

    © Copyright 2003-2004 Beman Dawes, Daniel Frey, David Abrahams.

    Distributed under the Boost Software License, Version 1.0. @@ -257,4 +277,4 @@ copy at www.boost.org/LICENSE_1_0 - \ No newline at end of file +

    boost.png (6897 bytes) Home