RGU Harvard Templates

Computer Code

If you are using a screen reader to view this page, please be aware that the templates and examples contain important punctuation and formatting, such as commas, full stops, uppercase text and italics, that are a vital part of referencing. You may need to change the punctuation settings and other settings on your screen reader software in order to correctly hear this information. It may work best to turn on an indication for capital letters and to navigate the templates one character at a time to ensure that all punctuation and capital letters are announced correctly. If you have any problems with this, please contact the library.

Examples

Template

We don’t provide a specific template for computer code, as how you reference this depends on the code’s source and how you are using it.

You should reference computer code in both your written work and coding work using the template for the source material where you found the code. The most common sources of code are:

Written assignments

If you quote or refer to code within a written assignment, you should provide an in-text citation and a full reference within your reference list at the end of the piece of work. Examples of citations and reference list entries are included in the templates for each source.

Coding Assignments

You also need to reference any code which you reuse or adapt within your own coding work. You do not need a separate citation and reference list, but you should include the full reference in an inline comment in your code to indicate the section of code that you have reused. Your reference should follow the format laid out in the relevant RGU Harvard template for the source of the code (see above).

If you modified the code when you reused it, include the words “Adapted from” or “Based on” before your reference to indicate this.