University of Canberra
Skip to Main Content

UC Referencing Guide

Computer Code / Source Code - In-text Citation

When using computer code from another source you should:

  • Cite the code that has been used, including snippets and adapted code.
  • Include the URL and date of retrieval in the citation, along with any extra details as needed.  Include the wording "Adapted from:" or "Based on:" for modified code.
  • Follow the terms of the open source licence that applies.  Good practice is to duplicate the copyright in your code, and / or store the licence in a file with the code.
  • Follow any guidelines from the unit convener.
Examples of citing code sources:
Example 1

In describing the class PluginProxyUtil in the Apache Project source code, the developer cites the source as a post in a forum and includes the URL, author and date:

/**
* A utility class that gives applets the ability to detect proxy host settings.
* This was adapted from a post from Chris Forster on 20030227 to a Sun Java
* forum here:
http://forum.java.sun.com/thread.jspa?threadID=364342&tstart=120
[…]
*/

(Source: Apache Project source code http://svn.apache.org retrieved in July 2019.)

Example 2

In the function OutputTraceToStream in the Google Chrome stack_trace_win source code, the developer cites the source code as the Microsoft Developer Network and includes a URL:

// Code adapted from MSDN example:
// http://msdn.microsoft.com/en-us/library/ms680578(VS.85).aspx 

(Source: https://github.com/adobe/chromium/blob/master/base/debug/stack_trace_win.cc retrieved in July 2019.)

Example of open-source-licensed code:

At the top of the Google Chrome stack_trace_win source file, note the copyright and reference to the open source license:

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

If you incorporate this code into a program, you should follow the terms outlined in The Chromium Authors' open source license file, which is shown below. While this license only requires that you duplicate the copyright and license if you are redistributing the code, it is good practice to always duplicate the copyright in your code, and/or store the license in a file with the code. This way, if you want to redistribute the code later, intellectual property reviewing becomes much easier.

// Copyright (c) 2014 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//* Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//* Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//* Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//

(Source: The Chromium Authors license file https://src.chromium.org/viewvc/chrome/trunk/src/LICENSE retrieved in July 2019.)

(These examples are taken from Academic Integrity at MIT: A handbook for students. https://integrity.mit.edu/handbook/writing-code)

Reference List Format

References are listed in numerical order.  The number sits to the left of the text.

[1]       T. Pitman, "The evolution of the student as a customer in Australian higher education: a policy perspective," Aust. Educ. Res., vol. 43, no. 3, pp. 345-359, May 2016, doi: 10.1007/s13384-016-0204-9.

[2]       L. Baiazitova, J. Skopalik, V. Cmiel, J. Chmelik, O. Svoboda and I Provaznik, "Modern semi-automatic set-up for testing cell migration with impact for therapy of yocardial infarction," in IFMBE Proc., May 2019, vol. 68, 3 ed., pp. 155-159, doi: 10.1007/978-981-10-9023-3_28.

[3]       J. Chapman, C. Landis and S. Smith, "The development of a library Research Methods course for online graduate students in education," in Information Literacy Programs in the Digital Age: Educating College and University Students Online, A. Daugherty and M. F. Russo, Eds. Chicago, IL, USA: Association of College and Research Libraries, 2007, ch. 3, pp. 13-22.

Computer Code / Source Code - Referencing

There are no guidelines for referencing computer or source code in the IEEE Reference Guide.  The Library is using the guidelines for computer programs.

Format

Title of Software. (version or year). Publisher. Accessed: Month Day, Year [Source code]. Available: URL

Example

GraphicsEditor. (3.0). Graph1. Accessed: Jan. 15, 2021. [Source code]. Available: http://Graph1.com/GraphicsEd