views:

43

answers:

2

Every software I have seen, contain copyright statement at the beginning of a file and takes pretty much lines of comment. Therefore you have to scroll down to see the code, which is a bit annoying, especially when code itself is very short.

I think that it would be nicer to keep copyright statement at the bottom of a file and join all clauses into single (or few) lines. This would be just to satisfy formal issues. Easy to read version is available in LICENSE file.

But I haven't seen such practice so far. Is it just a tribal custom or is there a reason for that?

edit: Here's <list> from GNU STL library as an example:

// <list> -*- C++ -*-

// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING.  If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.

// As a special exception, you may use this file as part of a free software
// library without restriction.  Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License.  This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.

/*
 *
 * Copyright (c) 1994
 * Hewlett-Packard Company
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Hewlett-Packard Company makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 *
 * Copyright (c) 1996,1997
 * Silicon Graphics Computer Systems, Inc.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Silicon Graphics makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 */

/** @file list
 *  This is a Standard C++ Library header.  You should @c #include this header
 *  in your programs, rather than any of the "st[dl]_*.h" implementation files.
 */

#ifndef _GLIBCXX_LIST
#define _GLIBCXX_LIST 1

#pragma GCC system_header

#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_list.h>

#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/list.tcc>
#endif

#ifdef _GLIBCXX_DEBUG
# include <debug/list>
#endif

#endif /* _GLIBCXX_LIST */
A: 

While it's not necessarily a custom or requirement, standards tend to dictate that comments should proceed any code definition. Take a look at NDOC notation as an example.

In the case of a copyright you generally want people to read it before they proceed with using your code (EULAs are always displayed at the beginning of an installer). If a copyright notice is placed at the bottom of the code definition there's a good chance it will be overlooked.

Nathan Taylor
Yep but I'm about license notification which usually isn't doc comment.
doc
Despite that, people tend to stick to what they know. The majority of people put their copyrights at the top, so why deviate? Personally, I see nothing wrong with putting it at the bottom, but if everyone else is jumping off the bridge, you might as well join them, right? =p
Nathan Taylor
A: 

If you put the copyright comment at the beginning of a file, the copyright statements are visible when somebody opens the file (if who opens the file doesn't use an editor that automatically goes to the last visited line). If the copyright comment would be placed at the bottom of the file, people would need to scroll until the end to see the copyright, which is the first thing somebody should be interested to see.

kiamlaluno
Do you read every source to get licensing information? I get information about licensing of particullar software from different places, like documentation, website or LICENSE file. If I'm interested in development of the particullar software, I will find the copyright notice anyway. I will benefit from easier access to the code, not from seeing copyright every time I open file.
doc
@doc: If there is a copyright comment in a source file, I give the priority to that. In some cases, a program can include source files with a license that is different (or slightly different) from the overall license, or the file has been written from a different person; in those cases, the copyright (or license) comment can be different from what reported in a different place.
kiamlaluno