Changes between Version 7 and Version 8 of CodingStyle

Oct 12, 2007, 10:10:45 AM (16 years ago)
Frederico Caldeira Knabben

Added "File Headers"


  • CodingStyle

    v7 v8  
    279279Other than shortnesses and better readability, regular expression literals are compiled during script evaluation, which improves performance.
     281== File Headers ==
     283There are minimum requirements for us to be able to make our code available to the world. Most of them are related to legal needs, which help us protecting the project from abuses.
     285Here is a JavaScript template for the header to be included in the source code:
     289 * FCKeditor - The text editor for Internet -
     290 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
     291 *
     292 * == BEGIN LICENSE ==
     293 *
     294 * Licensed under the terms of any of the following licenses at your
     295 * choice:
     296 *
     297 *  - GNU General Public License Version 2 or later (the "GPL")
     298 *
     299 *
     300 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
     301 *
     302 *
     303 *  - Mozilla Public License Version 1.1 or later (the "MPL")
     304 *
     305 *
     306 * == END LICENSE ==
     307 *
     308 * [File Description]
     309 */
     312Of course, different languages have different commenting syntax, so it is enough to copy the header from an existing file to maintain the style.
     314=== Author Tags ===
     316Author names, e-mails or web site addresses should be avoided in the header. To justify that, let me recall a citation from Sander Striker, a member of the Apache Software Foundation, that can be found at [ Producing Open Source Software]:
     318    At the Apache Software foundation we discourage the use of author tags in source code. There are various reasons for this, apart from the legal ramifications. Collaborative development is about working on projects as a group and caring for the project as a group. Giving credit is good, and should be done, but in a way that does not allow for false attribution, even by implication. There is no clear line for when to add or remove an author tag. Do you add your name when you change a comment? When you put in a one-line fix? Do you remove other author tags when you refactor the code and it looks 95% different? What do you do about people who go about touching every file, changing just enough to make the virtual author tag quota, so that their name will be everywhere?
     320    There are better ways to give credit, and our preference is to use those. From a technical standpoint author tags are unnecessary; if you wish to find out who wrote a particular piece of code, the version control system can be consulted to figure that out. Author tags also tend to get out of date. Do you really wish to be contacted in private about a piece of code you wrote five years ago and were glad to have forgotten?
     322The SVN is a good place to understand user participation. Even when committing changes proposed by Joe White, it is nice to add a comment like "Thanks to Joe White." in the commit message.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy