| 3 | | = Boost Library Requirements and Guidelines = #intro |
| 4 | | |
| 5 | | == Introduction == #Introduction |
| 6 | | |
| 7 | | This page describes requirements and guidelines for the |
| 8 | | content of a library submitted to Boost. |
| 9 | | |
| 10 | | See the |
| 11 | | [wiki:Guidelines/Submissions Boost Library Submission Process] |
| 12 | | page for a description of the process involved. |
| 13 | | |
| 14 | | == Requirements == #Requirements |
| 15 | | |
| 16 | | To avoid the frustration and wasted time of a proposed |
| 17 | | library being rejected, it must meets these requirements: |
| 18 | | |
| 19 | | * The license must meet the [#License license requirements] |
| 20 | | below. Restricted licenses like the GPL and |
| 21 | | LGPL are not acceptable. |
| 22 | | * The copyright [#Ownership ownership] must be |
| 23 | | clear. |
| 24 | | * The library must be generally useful and not restricted |
| 25 | | to a narrow problem domain. |
| 26 | | * The library must meet the [#Portability portability requirements] below. |
| 27 | | * The library must come reasonably close to meeting the |
| 28 | | [#Guidelines Guidelines] below. |
| 29 | | * [#Design_and_Programming Design and Programming] |
| 30 | | * [#Directory_structure Directory Structure] |
| 31 | | * [#Documentation Documentation] |
| 32 | | * The author must be willing to participate in discussions |
| 33 | | on the mailing list, and to refine the library |
| 34 | | accordingly. |
| 35 | | |
| 36 | | There's no requirement that an author read the mailing list |
| 37 | | for a time before making a submission. It has been noted, |
| 38 | | however, that submissions which begin "I just started to read |
| 39 | | this mailing list ..." seem to fail, often embarrassingly. |
| 40 | | |
| 41 | | === License requirements === #License |
| 42 | | |
| 43 | | The preferred way to meet the license requirements is to use |
| 44 | | the [http://www.boost.org/LICENSE_1_0.txt Boost Software License]. See |
| 45 | | [http://www.boost.org/users/license.html license information]. If for |
| 46 | | any reason you do not intend to use the Boost Software License, |
| 47 | | please discuss the issues on the Boost |
| 48 | | [http://www.boost.org/community/groups.html#main developers mailing list] |
| 49 | | first. |
| 50 | | |
| 51 | | The license requirements: |
| 52 | | |
| 53 | | * Must be simple to read and understand. |
| 54 | | * Must grant permission without fee to copy, use and modify |
| 55 | | the software for any use (commercial and |
| 56 | | non-commercial). |
| 57 | | * Must require that the license appear on all copies of the |
| 58 | | software source code. |
| 59 | | * Must not require that the license appear with executables |
| 60 | | or other binary uses of the library. |
| 61 | | * Must not require that the source code be available for |
| 62 | | execution or other binary uses of the library. |
| 63 | | * May restrict the use of the name and description of the |
| 64 | | library to the standard version found on the Boost web |
| 65 | | site. |
| 66 | | |
| 67 | | === Portability requirements === #Portability |
| 68 | | |
| 69 | | * A library's interface must portable and not restricted to |
| 70 | | a particular compiler or operating system. |
| 71 | | * A library's implementation must if possible be portable |
| 72 | | and not restricted to a particular compiler or operating |
| 73 | | system. If a portable implementation is not possible, |
| 74 | | non-portable constructions are acceptable if reasonably easy |
| 75 | | to port to other environments, and implementations are |
| 76 | | provided for at least two popular operating systems (such as |
| 77 | | UNIX and Windows). |
| 78 | | * There is no requirement that a library run on C++ |
| 79 | | compilers which do not conform to the ISO standard. |
| 80 | | * There is no requirement that a library run on any |
| 81 | | particular C++ compiler. Boost contributors often try to |
| 82 | | ensure their libraries work with popular compilers. The |
| 83 | | boost/config.hpp |
| 84 | | [http://www.boost.org/doc/libs/release/libs/config/config.htm configuration header] |
| 85 | | is the preferred mechanism for working around |
| 86 | | compiler deficiencies. |
| 87 | | |
| 88 | | Since there is no absolute way to prove portability, many |
| 89 | | boost submissions demonstrate practical portability by |
| 90 | | compiling and executing correctly with two different C++ |
| 91 | | compilers, often under different operating systems. Otherwise |
| 92 | | reviewers may disbelieve that porting is in fact practical. |
| 93 | | |
| 94 | | === Ownership === #Ownership |
| 95 | | |
| 96 | | Are you sure you own the library you are thinking of |
| 97 | | submitting? "How to Copyright Software" by MJ Salone, Nolo |
| 98 | | Press, 1990 says: |
| 99 | | |
| 100 | | Doing work on your own time that is very similar to |
| 101 | | programming you do for your employer on company time can |
| 102 | | raise nasty legal problems. In this situation, it's best to |
| 103 | | get a written release from your employer in advance. |
| 104 | | |
| 105 | | Place a copyright notice in all the important files you |
| 106 | | submit. Boost won't accept libraries without clear copyright |
| 107 | | information. |
| 108 | | |
| 109 | | == Guidelines == #Guidelines |
| 110 | | |
| 111 | | Please use these guidelines as a checklist for preparing the |
| 112 | | content a library submission. Not every guideline applies to |
| 113 | | every library, but a reasonable effort to comply is |
| 114 | | expected. |
| 115 | | |
| 116 | | === Design and Programming === #Design_and_Programming |
| 117 | | |
| 118 | | Aim first for clarity and correctness; optimization should |
| 119 | | be only a secondary concern in most Boost libraries. |
| 120 | | |
| 121 | | Aim for ISO Standard C++. Than means making effective use of |
| 122 | | the standard features of the language, and avoiding |
| 123 | | non-standard compiler extensions. It also means using the C++ |
| 124 | | Standard Library where applicable. |
| 125 | | |
| 126 | | Headers should be good neighbors. See the |
| 127 | | [wiki:Guidelines/Header header policy]. See |
| 128 | | [#Naming_consistency Naming consistency]. |
| 129 | | |
| 130 | | Follow quality programming practices. See, for example, |
| 131 | | "Effective C++" 2nd Edition, and "More Effective C++", both by |
| 132 | | Scott Meyers, published by Addison Wesley. |
| 133 | | |
| 134 | | Use the C++ Standard Library or other Boost libraries, but |
| 135 | | only when the benefits outweigh the costs. Do not use libraries |
| 136 | | other than the C++ Standard Library or Boost. See |
| 137 | | [wiki:Guidelines/Reuse Library reuse]. |
| 138 | | |
| 139 | | Read |
| 140 | | [http://www.boost.org/community/implementation_variations.html Implementation Variation] |
| 141 | | to see how to supply performance, platform, or |
| 142 | | other implementation variations. |
| 143 | | |
| 144 | | Read the |
| 145 | | [wiki:Guidelines/Separate guidelines for libraries with separate source] |
| 146 | | to see how to ensure that compiled link libraries meet user expectations. |
| 147 | | |
| 148 | | Use the naming conventions of the C++ Standard Library (See |
| 149 | | [#Naming Naming conventions rationale]): |
| 150 | | |
| 151 | | * Names (except as noted below) should be all lowercase, |
| 152 | | with words separated by underscores. |
| 153 | | * Acronyms should be treated as ordinary names (e.g. |
| 154 | | `xml_parser` instead of |
| 155 | | `XML_parser`). |
| 156 | | * Template parameter names begin with an uppercase |
| 157 | | letter. |
| 158 | | * Macro (gasp!) names all uppercase and begin with `BOOST_`. |
| 159 | | |
| 160 | | Choose meaningful names - explicit is better than implicit, |
| 161 | | and readability counts. There is a strong preference for clear |
| 162 | | and descriptive names, even if lengthy. |
| 163 | | |
| 164 | | Use exceptions to report errors where appropriate, and write |
| 165 | | code that is safe in the face of exceptions. |
| 166 | | |
| 167 | | Avoid exception-specifications. See |
| 168 | | [#Exception-specification exception-specification rationale]. |
| 169 | | |
| 170 | | Provide sample programs or confidence tests so potential |
| 171 | | users can see how to use your library. |
| 172 | | |
| 173 | | Provide a regression test program or programs which follow |
| 174 | | the [wiki:Guidelines/Test Test Policies and Protocols]. |
| 175 | | |
| 176 | | Although some boost members use proportional fonts, tabs, |
| 177 | | and unrestricted line lengths in their own code, boost's widely |
| 178 | | distributed source code should follow more conservative |
| 179 | | guidelines: |
| 180 | | |
| 181 | | * Use fixed-width fonts. See [#code_fonts fonts rationale]. |
| 182 | | * Use spaces rather than tabs. See [#Tabs tabs rationale]. |
| 183 | | * Limit line lengths to 80 characters. |
| 184 | | |
| 185 | | End all documentation files (HTML or otherwise) with a |
| 186 | | copyright message and a licensing message. See the |
| 187 | | [http://www.boost.org/users/license.html license information] page for the |
| 188 | | preferred form. |
| 189 | | |
| 190 | | Begin all source files (including programs, headers, |
| 191 | | scripts, etc.) with: |
| 192 | | |
| 193 | | * A comment line describing the contents of the file. |
| 194 | | * Comments describing copyright and licensing: again, the |
| 195 | | preferred form is indicated in the |
| 196 | | [http://www.boost.org/users/license.html license information] page |
| 197 | | * Note that developers should not provide a copy of |
| 198 | | `LICENSE_1_0.txt` with their libraries: Boost |
| 199 | | distributions already include a copy in the Boost root |
| 200 | | directory. |
| 201 | | * A comment line referencing your library on the Boost web |
| 202 | | site. For example: |
| 203 | | {{{ |
| 204 | | // See http://www.boost.org/libs/foo for library home page. |
| 205 | | }}} |
| 206 | | Where `foo` is the directory name (see below) |
| 207 | | for the library. As well as aiding users who come across a |
| 208 | | Boost file detached from its documentation, some of Boost's |
| 209 | | automatic tools depend on this comment to identify which |
| 210 | | library header files belong to. |
| 211 | | |
| 212 | | Make sure your code compiles in the presence of the |
| 213 | | `min()` and `max()` macros. Some platform |
| 214 | | headers define `min()` and `max()` macros |
| 215 | | which cause some common C++ constructs to fail to compile. Some |
| 216 | | simple tricks can protect your code from inappropriate macro |
| 217 | | substitution: |
| 218 | | |
| 219 | | * If you want to call `std::min()` or |
| 220 | | `std::max()`: |
| 221 | | * If you do not require argument-dependent look-up, use |
| 222 | | `(std::min)(a,b)`. |
| 223 | | * If you do require argument-dependent look-up, you should: |
| 224 | | * `#include <boost/config.hpp>` |
| 225 | | * Use `BOOST_USING_STD_MIN();` to bring |
| 226 | | `std::min()` into the current scope. |
| 227 | | * Use `min BOOST_PREVENT_MACRO_SUBSTITUTION |
| 228 | | (a,b);` to make an argument-dependent call to `min(a,b)`. |
| 229 | | * If you want to call |
| 230 | | `std::numeric_limits<int>::max()`, use |
| 231 | | `(std::numeric_limits<int>::max)()` |
| 232 | | instead. |
| 233 | | * If you want to call a `min()` or |
| 234 | | `max()` member function, instead to doing |
| 235 | | `obj.min()`, use `(obj.min)()`. |
| 236 | | * If you want to declare or define a function or a member |
| 237 | | function named `min` or `max`, then you |
| 238 | | must use the `BOOST_PREVENT_MACRO_SUBSTITUTION` |
| 239 | | macro. Instead of writing `int min() { return 0; }` |
| 240 | | you should write |
| 241 | | `int min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }` |
| 242 | | This is true regardless if the function is a free (namespace |
| 243 | | scope) function, a member function or a static member |
| 244 | | function, and it applies for the function declaration as well |
| 245 | | as for the function definition. |
| 246 | | |
| 247 | | === Directory Structure and Filenames === #Directory_structure |
| 248 | | |
| 249 | | Naming requirements ensure that file and directory names are |
| 250 | | relatively portable, including to ISO 9660:1999 (with |
| 251 | | extensions) and other relatively limited file systems. |
| 252 | | Superscript links are provided to detailed rationale for each |
| 253 | | choice. |
| 254 | | |
| 255 | | * Names must contain only |
| 256 | | '''lowercase'''^[#Filename_rationale_1 1]^ ASCII letters |
| 257 | | (`'a'`-`'z'`), numbers |
| 258 | | (`'0'`-`'9'`), underscores |
| 259 | | (`'_'`), hyphens (`'-'`), and periods |
| 260 | | (`'.'`). Spaces are not allowed^[#Filename_rationale_2 2]^. |
| 261 | | * Directory names must not contain periods |
| 262 | | (`'.'`)^[#Filename_Rationale_3 3]^. |
| 263 | | * The first and last character of a file name must not be a |
| 264 | | period (`'.'`)^[#Filename_rationale_4 4]^. |
| 265 | | * The first character of names must not be a hyphen |
| 266 | | (`'-'`)^[#Filename_rationale_5 5]^. |
| 267 | | * The maximum length of directory and file names is 31 |
| 268 | | characters^[#Filename_rationale_6 6]^. |
| 269 | | * The total path length must not exceed 207 |
| 270 | | characters^[#Filename_rationale_7 7]^. |
| 271 | | |
| 272 | | Other conventions ease communication: |
| 273 | | |
| 274 | | * Files intended to be processed by a C++ compiler as part |
| 275 | | of a translation unit should have '''a three-letter |
| 276 | | filename extension ending in "pp"'''. Other files |
| 277 | | should ''not'' use extensions ending in "pp". This |
| 278 | | convention makes it easy to identify all of the C++ source in |
| 279 | | Boost. |
| 280 | | * All libraries have at their highest level a primary |
| 281 | | directory named for the particular library. See |
| 282 | | [#Naming_consistency Naming consistency]. The primary |
| 283 | | directory may have sub-directories. |
| 284 | | * For very simple libraries implemented entirely within the |
| 285 | | library header, all files go in the primary directory (except |
| 286 | | headers, which go in the boost header directory). |
| 287 | | |
| 288 | | ==== Boost standard sub-directory names ==== #subdirectory |
| 289 | | |
| 290 | | ||Sub-directory||Contents ||Required || |
| 291 | | ||`build` ||Library build files such as a Jamfile. ||If any build files. || |
| 292 | | ||`doc` ||Documentation (HTML) files. ||If several doc files. || |
| 293 | | ||`example` ||Sample program files. ||If several sample files.|| |
| 294 | | ||`src` ||Source files which must be compiled to build the library.||If any source files. || |
| 295 | | ||`test` ||Regression or other test programs or scripts. ||If several test files. || |
| 296 | | |
| 297 | | ==== Redirection ==== #Redirection |
| 298 | | |
| 299 | | The primary directory should always contain a file named |
| 300 | | index.html (or index.htm). Authors have requested this so that |
| 301 | | they can publish URL's in the form |
| 302 | | ''http://www.boost.org/libs/lib-name'' with the assurance a |
| 303 | | documentation reorganization won't invalidate the URL. Boost's |
| 304 | | internal tools are also simplified by knowing that a library's |
| 305 | | documentation is always reachable via the simplified URL. |
| 306 | | |
| 307 | | If the documentation is in a doc sub-directory, the primary |
| 308 | | directory index.html file should just do an automatic |
| 309 | | redirection to the doc subdirectory: |
| 310 | | {{{ |
| 311 | | #!html |
| 312 | | <pre> |
| 313 | | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 314 | | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 315 | | |
| 316 | | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
| 317 | | <head> |
| 318 | | <title>Boost.<var>Name</var> Documentation</title> |
| 319 | | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> |
| 320 | | <meta http-equiv="refresh" content="0; URL=doc/index.html" /> |
| 321 | | </head> |
| 322 | | |
| 323 | | <body> |
| 324 | | Automatic redirection failed, please go to <a href= |
| 325 | | "doc/index.html">doc/index.html</a> |
| 326 | | </body> |
| 327 | | </html> |
| 328 | | </pre> |
| 329 | | }}} |
| 330 | | |
| 331 | | === Naming consistency === #Naming_consistency |
| 332 | | |
| 333 | | As library developers and users have gained experience with |
| 334 | | Boost, the following consistent naming approach has come to be |
| 335 | | viewed as very helpful, particularly for larger libraries that |
| 336 | | need their own header subdirectories and namespaces. |
| 337 | | |
| 338 | | Here is how it works. The library is given a name that |
| 339 | | describes the contents of the library. Cryptic abbreviations |
| 340 | | are strongly discouraged. Following the practice of the C++ |
| 341 | | Standard Library, names are usually singular rather than |
| 342 | | plural. For example, a library dealing with file systems might |
| 343 | | chose the name "filesystem", but not "filesystems", "fs" or |
| 344 | | "nicecode". |
| 345 | | |
| 346 | | * The library's primary directory (in parent |
| 347 | | ''boost-root/libs'') is given that same name. For |
| 348 | | example, ''boost-root/libs/filesystem''. |
| 349 | | * The library's primary header directory (in parent |
| 350 | | ''boost-root/boost'') is given that same name. For |
| 351 | | example, ''boost-root/boost/filesystem''. |
| 352 | | * The library's primary namespace (in parent |
| 353 | | ''::boost'') is given that same name, except when |
| 354 | | there's a component with that name (e.g., |
| 355 | | ''boost::tuple''), in which case the namespace name is |
| 356 | | pluralized. For example, ''::boost::filesystem''. |
| 357 | | |
| 358 | | When documenting Boost libraries, follow these conventions |
| 359 | | (see also the following section of this document): |
| 360 | | |
| 361 | | * The library name is set in roman type. |
| 362 | | * The library name is capitalized. |
| 363 | | * A period between "Boost" and the library name (e.g., |
| 364 | | Boost.Bind) is used if and only if the library name is not |
| 365 | | followed by the word "library". |
| 366 | | * The word "library" is not part of the library name and is |
| 367 | | therefore lowercased. |
| 368 | | |
| 369 | | Here are a few examples of how to apply these |
| 370 | | conventions: |
| 371 | | |
| 372 | | * Boost.Bind was written by Peter Dimov. |
| 373 | | * The Boost Bind library was written by Peter Dimov. |
| 374 | | * I regularly use Bind, a Boost library written by Peter Dimov. |
| 375 | | |
| 376 | | === Documentation === #Documentation |
| 377 | | |
| 378 | | Even the simplest library needs some documentation; the |
| 379 | | amount should be proportional to the need. The documentation |
| 380 | | should assume the readers have a basic knowledge of C++, but |
| 381 | | are not necessarily experts. |
| 382 | | |
| 383 | | The format for documentation should be HTML, and should not |
| 384 | | require an advanced browser or server-side extensions. Style |
| 385 | | sheets are acceptable. ECMAScript/JavaScript is not acceptable. |
| 386 | | The documentation entry point should always be a file named |
| 387 | | index.html or index.htm; see [#Redirection Redirection]. |
| 388 | | |
| 389 | | There is no single right way to do documentation. HTML |
| 390 | | documentation is often organized quite differently from |
| 391 | | traditional printed documents. Task-oriented styles differ from |
| 392 | | reference oriented styles. In the end, it comes down to the |
| 393 | | question: Is the documentation sufficient for the mythical |
| 394 | | "average" C++ programmer to use the library successfully? |
| 395 | | |
| 396 | | Appropriate topics for documentation often include: |
| 397 | | |
| 398 | | * General introduction to the library. The introduction |
| 399 | | particularly needs to include: |
| 400 | | * A very high-level overview of what the library is |
| 401 | | good for, and perhaps what it isn't good for, |
| 402 | | understandable even by those with no prior knowledge of |
| 403 | | the problem domain. |
| 404 | | * The simplest possible ("hello world") example of |
| 405 | | using the library. |
| 406 | | * Tutorial covering basic use cases. |
| 407 | | * Reference documentation: |
| 408 | | * Description of each class. |
| 409 | | * Relationship between classes. |
| 410 | | * For each function, as applicable, description, |
| 411 | | requirements (preconditions), effects, post-conditions, |
| 412 | | returns, and throws. |
| 413 | | * Discussion of error detection and recovery |
| 414 | | strategy. |
| 415 | | * How to compile and link. |
| 416 | | * How to test. |
| 417 | | * Version or revision history. |
| 418 | | * Rationale for design decisions. See [#Rationale Rationale rationale]. |
| 419 | | * Acknowledgements. See [#Acknowledgements Acknowledgments rationale.] |
| 420 | | |
| 421 | | If you need more help with how to write documentation you |
| 422 | | can check out the article on |
| 423 | | [http://www.boost.org/doc/libs/release/more/writingdoc/index.html Writing Documentation for Boost]. |
| 424 | | |
| 425 | | == Rationale == #Rationale |
| 426 | | |
| 427 | | Rationale for some of the requirements and guidelines |
| 428 | | follows. |
| 429 | | |
| 430 | | === Exception-specification rationale === #Exception-specification |
| 431 | | |
| 432 | | Exception specifications [ISO 15.4] are sometimes coded to |
| 433 | | indicate what exceptions may be thrown, or because the |
| 434 | | programmer hopes they will improve performance. But consider |
| 435 | | the following member from a smart pointer: |
| 436 | | {{{ |
| 437 | | T& operator*() const throw() { return *ptr; } |
| 438 | | }}} |
| 439 | | |
| 440 | | This function calls no other functions; it only manipulates |
| 441 | | fundamental data types like pointers Therefore, no runtime |
| 442 | | behavior of the exception-specification can ever be invoked. |
| 443 | | The function is completely exposed to the compiler; indeed it |
| 444 | | is declared inline Therefore, a smart compiler can easily |
| 445 | | deduce that the functions are incapable of throwing exceptions, |
| 446 | | and make the same optimizations it would have made based on the |
| 447 | | empty exception-specification. A "dumb" compiler, however, may |
| 448 | | make all kinds of pessimizations. |
| 449 | | |
| 450 | | For example, some compilers turn off inlining if there is an |
| 451 | | exception-specification. Some compilers add try/catch blocks. |
| 452 | | Such pessimizations can be a performance disaster which makes |
| 453 | | the code unusable in practical applications. |
| 454 | | |
| 455 | | Although initially appealing, an exception-specification |
| 456 | | tends to have consequences that require '''very''' |
| 457 | | careful thought to understand. The biggest problem with |
| 458 | | exception-specifications is that programmers use them as though |
| 459 | | they have the effect the programmer would like, instead of the |
| 460 | | effect they actually have. |
| 461 | | |
| 462 | | A non-inline function is the one place a "throws nothing" |
| 463 | | exception-specification may have some benefit with some |
| 464 | | compilers. |
| 465 | | |
| 466 | | === Naming conventions rationale === #Naming |
| 467 | | |
| 468 | | The C++ standard committee's Library Working Group discussed |
| 469 | | this issue in detail, and over a long period of time. The |
| 470 | | discussion was repeated again in early boost postings. A short |
| 471 | | summary: |
| 472 | | |
| 473 | | * Naming conventions are contentious, and although several |
| 474 | | are widely used, no one style predominates. |
| 475 | | * Given the intent to propose portions of boost for the |
| 476 | | next revision of the C++ standard library, boost decided to |
| 477 | | follow the standard library's conventions. |
| 478 | | * Once a library settles on a particular convention, a vast |
| 479 | | majority of stakeholders want that style to be consistently |
| 480 | | used. |
| 481 | | |
| 482 | | === Source code fonts rationale === #code_fonts |
| 483 | | |
| 484 | | Dave Abrahams comments: An important purpose (I daresay the |
| 485 | | primary purpose) of source code is communication: the |
| 486 | | documentation of intent. This is a doubly important goal for |
| 487 | | boost, I think. Using a fixed-width font allows us to |
| 488 | | communicate with more people, in more ways (diagrams are |
| 489 | | possible) right there in the source. Code written for |
| 490 | | fixed-width fonts using spaces will read reasonably well when |
| 491 | | viewed with a variable-width font, and as far as I can tell |
| 492 | | every editor supporting variable-width fonts also supports |
| 493 | | fixed width. I don't think the converse is true. |
| 494 | | |
| 495 | | === Tabs rationale === #Tabs |
| 496 | | |
| 497 | | Tabs are banned because of the practical problems caused by |
| 498 | | tabs in multi-developer projects like Boost, rather than any |
| 499 | | dislike in principle. See [http://www.boost.org/community/groups.html#archive mailing list archives]. |
| 500 | | Problems include maintenance of a single source file by |
| 501 | | programmers using tabs and programmers using spaces, and the |
| 502 | | difficulty of enforcing a consistent tab policy other than just |
| 503 | | "no tabs". Discussions concluded that Boost files should either |
| 504 | | all use tabs, or all use spaces, and thus the decision to stick |
| 505 | | with spaces. |
| 506 | | |
| 507 | | === Directory and File Names rationale === #FileNamesRat |
| 508 | | |
| 509 | | {{{ |
| 510 | | #!html |
| 511 | | <a name="Filename_rationale_1" id="Filename_rationale_1"></a> |
| 512 | | }}} |
| 513 | | 1. Some legacy file systems require |
| 514 | | single-case names. Single-case names eliminate casing mistakes |
| 515 | | when moving from case-insensitive to case-sensitive file |
| 516 | | systems. |
| 517 | | |
| 518 | | {{{ |
| 519 | | #!html |
| 520 | | <a name="Filename_rationale_2" id="Filename_rationale_2"></a> |
| 521 | | }}} |
| 522 | | 2. This is the lowercase portion of |
| 523 | | the POSIX portable filename character set. To quote the POSIX |
| 524 | | standard, "Filenames should be constructed from the portable |
| 525 | | filename character set because the use of other characters can |
| 526 | | be confusing or ambiguous in certain contexts." |
| 527 | | |
| 528 | | {{{ |
| 529 | | #!html |
| 530 | | <a name="Filename_rationale_3" id="Filename_rationale_3"></a> |
| 531 | | }}} |
| 532 | | 3.Strict implementations of ISO |
| 533 | | 9660:1999 and some legacy operating systems prohibit dots in |
| 534 | | directory names. The need for this restriction is fading, and |
| 535 | | it will probably be removed fairly soon. |
| 536 | | |
| 537 | | {{{ |
| 538 | | #!html |
| 539 | | <a name="Filename_rationale_4" id="Filename_rationale_4"></a> |
| 540 | | }}} |
| 541 | | 4. POSIX has special rules for names |
| 542 | | beginning with a period. Windows prohibits names ending in a |
| 543 | | period. |
| 544 | | |
| 545 | | {{{ |
| 546 | | #!html |
| 547 | | <a name="Filename_rationale_5" id="Filename_rationale_5"></a> |
| 548 | | }}} |
| 549 | | 5.Would be too confusing or ambiguous in certain contexts. |
| 550 | | |
| 551 | | {{{ |
| 552 | | #!html |
| 553 | | <a name="Filename_rationale_6" id="Filename_rationale_6"></a> |
| 554 | | }}} |
| 555 | | 6.We had to draw the line |
| 556 | | somewhere, and so the limit imposed by a now obsolete Apple |
| 557 | | file system was chosen years ago. It still seems a reasonable |
| 558 | | limit to aid human comprehension. |
| 559 | | |
| 560 | | {{{ |
| 561 | | #!html |
| 562 | | <a name="Filename_rationale_7" id="Filename_rationale_7"></a> |
| 563 | | }}} |
| 564 | | 7.ISO 9660:1999. |
| 565 | | |
| 566 | | === ECMAScript/JavaScript rationale === #JavaScript |
| 567 | | |
| 568 | | Before the 1.29.0 release, two Boost libraries added |
| 569 | | ECMAScript/JavaScript documentation. Controversy followed (see |
| 570 | | [http://www.boost.org/community/groups.html#archive mailing list archives]), |
| 571 | | and the developers were asked to remove the |
| 572 | | ECMAScript/JavaScript. Reasons given for banning included: |
| 573 | | |
| 574 | | * Incompatible with some older browsers and some text based |
| 575 | | browsers. |
| 576 | | * Makes printing docs pages difficult. |
| 577 | | * Often results in really bad user interface design. |
| 578 | | * "It's just annoying in general." |
| 579 | | * Would require Boost to test web pages for |
| 580 | | ECMAScript/JavaScript compliance. |
| 581 | | * Makes docs maintenance by other than the original |
| 582 | | developer more difficult. |
| 583 | | |
| 584 | | === Rationale rationale === #Rationale_rationale |
| 585 | | |
| 586 | | Rationale is defined as "The fundamental reasons for |
| 587 | | something; basis" by the American Heritage Dictionary. |
| 588 | | |
| 589 | | Beman Dawes comments: Failure to supply contemporaneous |
| 590 | | rationale for design decisions is a major defect in many |
| 591 | | software projects. Lack of accurate rationale causes issues to |
| 592 | | be revisited endlessly, causes maintenance bugs when a |
| 593 | | maintainer changes something without realizing it was done a |
| 594 | | certain way for some purpose, and shortens the useful lifetime |
| 595 | | of software. |
| 596 | | |
| 597 | | Rationale is fairly easy to provide at the time decisions |
| 598 | | are made, but very hard to accurately recover even a short time |
| 599 | | later. |
| 600 | | |
| 601 | | === Acknowledgements rationale === #Acknowledgements |
| 602 | | |
| 603 | | As a library matures, it almost always accumulates |
| 604 | | improvements suggested to the authors by other boost members. |
| 605 | | It is a part of the culture of boost.org to acknowledge such |
| 606 | | contributions, identifying the person making the suggestion. |
| 607 | | Major contributions are usually acknowledged in the |
| 608 | | documentation, while minor fixes are often mentioned in |
| 609 | | comments within the code itself. |
| 610 | | |
| 611 | | Copyright Beman Dawes, 2003. |
| | 3 | This has been move back to the [http://www.boost.org/development/requirements.html main site] |