Documentation used while coding is the equivalent of a dictionary used while writing an essay. It provides insight and/or snippets of individual commands, not a larger concept. Documentation may provide insight on:
if statement to make a decisionfor loop to repeat codeCopying from documentation usually involves only copying a few lines of code at a time. The copied code will not function in its copied state; it will need to be modified and/or have code added before it will achieve an objective.
Copying code from documentation does not require any citation and is permitted on almost all assignments.
However, sometimes identifying which code snippets are considered documentation and which snippets are considered examples can be difficult. To make things harder, documentation often appears on the same website as examples, and sometimes even on the same page.
Below are a series of documentation snippets. The snippets include a variety of different languages and sources.

Below is a snippet of code from the W3Schools page displayed above.

This code provides documentation on how to use the img tag. This snippet could not be subject to copyright because it is very likely that two programmers would come up with practically the same code. Notice that the snippet has no objective (such as an image slideshow, a hero image banner, or an image zoom tool). These would all be considered example code snippets.
Code from W3Schools is free to use and manipulate. It has been released under the Fair Use License. More information on the terms of use is available on the W3Schools website.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
Below is a JavaScript code snippet from the Mozilla Developer Network page displayed above. This code provides documentation on how to define a function:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function
This snippet could not be copyrighted because it is very likely that two programmers would come up with practically the same code. It is also unlikely that this code could even be used in a project, as the code is simply an empty shell of a function definition that still needs to be given a proper name and additional code to achieve a purpose.
Code from the Mozilla Developer Network website is licensed under the Creative Commons Attribution. More information on the terms of use is available on the Mozilla Developer Network website.

Below is a PHP code snippet from php.net. This code provides the syntax for user-defined functions:

Like the JavaScript snippet, this code is still lacking any purpose. It is an empty shell ready to be copied into a project and customized.
However, on the same website, below the documentation, is a series of user contributed code snippets:

The above code is a function that can be used to send a UTF-8 formatted email using PHP. Assuming the assignment allows the use of code examples, this code is subject to copyright and must include a citation.
Code from the PHP website is free to use under the Creative Commons Attribution License.
In the next chapter we will review the use of online coding examples and how to incorporate code from these sources into student work.
Previous Chapter - Home - Next Chapter