Skip to Main Content

General Use: Getting Started with Research: Citing Computer Code

Sometimes the hardest part of research is getting started! Here are some tutorials and tools to help.

What is Common Knowledge?

"Common knowledge" -- you don't need to cite where you found "common knowledge".  But what is "common knowledge"?  Guess what -- it varies.  Here is a safe definition, because you don't want to be accused of plagiarism. 

Did you know it without looking it up?  If you are just learning about your field, you should err on the side of caution.  Better to cite something that didn't need a citation, than to be accused of plagiarism.

Would other people in the class know this?  Common knowledge is based, to some extent, on what the "general practitioner" in the field would know.  And what would be general knowledge for a practicing electrical engineer MAY NOT be common knowledge for a freshman engineering student.

Do you find the information in many PUBLISHED (not web pages) resources? Some experts say if you find it in 3 reference tools, no need to cite. Others say 5. If you don't have time to check that the information has been used in many different places, cite it.  Play it safe.  The citation can be easily removed later and until the paper is in it's final version, you will know where to go back and verify the information.

  • Example 1:  Water boils at 100 °C.  (I looked it up to make sure I was right.  Still it is common knowledge and I will not cite my source.)
  • Example 2:  The melting point of acacetin is 263 °C.  (For an organic chemist, this might be common knowledge.  For me it is not.  I would cite it for two reasons. First, I had to go find it. Second, I want to show the reader it is valid number.)
  • Example 3: Nixon resigned from the US Presidency. (Common knowledge)
  • Example 4: Nixon resigned from the US Presidency at the urging of .......  (Not so common knowledge, I would cite where I found that information.)

Why Cite?

  • When you use other authors' ideas and words in your writing, it is important to credit them - even if you do not quote their words exactly as written.
  • Citing your sources allows your reader to identify the works you have consulted and to understand the breadth and scope of your research. Footnotes and lists of works consulted provide substantiation for your own findings and ideas.
  • Practicing "cite as you write" and keeping track of ideas and quotations that you use in your own writing helps you to avoid plagiarism or charges of academic dishonesty.
  • According to the ACM (Association of Computing Machinery) "Plagiarism, in which one misrepresents ideas, words, computer codes or other creative expression as one's own, is a clear violation of such ethical principles."  Please go to their site for more complete information.

Cite Right!

The ACM and IEEE each have specific style guides.  Here are some general statements that may help you with IEEE and ACM styles.

There are two parts to citing correctly:

First, indicate in the sentence that there is supporting information and/or that the information used is quoted or paraphrased.  There are two basic methods.
  The In-text citation used by most IEEE and ACM publications is a numbering system
        [#] as a superscript or normal text
        (#) as a superscript or normal text
        # as a superscription (hardest to see!) AND
Second, a full citation for each item referenced is included in a bibliography, a works cited list, or as end  notes.  Generally if, in-line citations are used, then the bibliography or works cited list is arranged alphabetically by authors' last names.  When a numbering system is used, the arrangement of the reference lists can be either in the order cited or alphabetically.

For class assignments, it is possible that the resources listed in the bibliography are not all directly referenced in the report/paper.  Speak with the instructor on how these should be included, if a number list is expected.

Each reference should have enough information to clearly identify the piece being cited.  The information needed generally includes the following elements.  The elements are listed in the most common order in scientific styles and the elements of a journal citation are colored.  These elements should be divided by consistent punctuation in the reference.

    Last name and initials (or full name) of all authors
    Year of publication
    Title of paper, report or book chapter
    Last name and initials (or full name) of all editors (for book or conference)
    Title of periodical (or journal), conference proceedings or book
    Volume number and issue number (if needed)
    Name of publisher and their location (for books, documents, reports)
    Conference location and sponsoring organization
    Inclusive page numbers
    URL, DOI or permalink
    Access date

Computer Code

The reuse of code can be seen as good practice but copying other peoples computer code without citing it correctly may be a plagiarism violation.

It is not always clear how to correctly reference programs and source code. The information on this page explains how to cite programs and source code correctly within reports and in the source code itself.  Remember, your teacher is the final expert in this matter. 

When in doubt, consult.

Knowing When to Cite - Common Knowledge

As a programmer it can be difficult to to know what resources need to be cited and what resources don't. Generally, if you used a function or algorithm that you did not create and it came from someone else then this should be cited so as to give the creator credit. Ideas and programs that are "common knowledge" do not generally need to be referenced or cited.  If there is only one way to program for a specific task and this is so commonly used then it may not need to be cited. A good example of this is a "hello world" program such as the following (in Java):

class HelloWorld 
{
      public static void main (String[] args) 
      {
            System.out.println ("Hello World");
      }
}

If you are unsure about whether a section of code that you are using needs to be cited then you should ask your teacher. They will be able to advise as to what you should do.

An added benefit of citing correctly is that it makes your code easier to maintain.

Citing Computer Code in the Source Code

To cite either a computer program or piece of source code you will need the following information:

- Author(s) name (Individual or corporation)
- Date
- Title of program/source code
- Code version
- Type (e.g. computer program, source code)
- Availability (e.g. program publisher, URL)

When citing within the code, the citation information could be placed as a comment above the reused code, as shows below:

/***************************************************************************************
*    Title: <title of program/source code>
*    Author: <author(s) names>
*    Date: <date>
*    Code version: <code version>
*    Availability: <where it's located>
*
***************************************************************************************/

e.g.

***************************************************************************************/
*    Title: GraphicsDrawer source code
*    Author: Smith, J
*    Date: 2011
*    Code version: 2.0
*    Availability: http://www.graphicsdrawer.com
*
***************************************************************************************/
(Version 2.0) [Source code]. http://www.graphicsdrawer.com

Citing Computer Code in Report or Paper

To cite either a computer program or piece of source code you will need the following information:

- Author(s) name (Individual or corporation)
- Date
- Title of program/source code
- Code version
- Type (e.g. computer program, source code)
- Web address or publisher (e.g. program publisher, URL)

When writing a report and citing within the text, the following method (based on common IEEE and ACM citiation rules for other types of references) can be used:

<author(s) names> (<date>) <title of program/source code> (<code version>) [<type>]. Web address or publisher.

Smith, J (2011) GraphicsDrawer source code (Version 2.0) [Source code]. http://www.graphicsdrawer.com

Credit for Information on this Page

The information on this page was developed by Jay McAllister at the University of Arkansas Libraries. It is used with permission. Find original content at https://uark.libguides.com/CSCE/Home