Reading & Writing Documentation

Projected Time

About 2 hours

Prerequisites

Motivation

Software engineers frequently reference a language’s or a framework’s documentation to understand how to use some part of that technology. It’s therefore important to know how documentation is intended to help you, and also how to read it effectively and efficiently.

You will someday want to write documentation for a project you’re working on in order to tell or show others how to use the project.

This is such an important topic in software development that many IDE companies provide languages specific extensions to help incorporate and standardize documentation in your code. For example Apple provides this support for Swift in Xcode https://developer.apple.com/library/archive/documentation/Xcode/Reference/xcode_markup_formatting_ref/SymbolDocumentation.html. For JavaScript the Mozilla organization (originally Netscape) created the industry standard JSDoc https://en.wikipedia.org/wiki/JSDoc supported by many IDEs including Microsoft’s VSCode.

Objectives

Participants will be able to:

Specific Things to Learn

Lesson

Common Mistakes / Misconceptions

Demonstration

Via instructor-led Group Practice.

Group Practice

Look at this JavaScript code snippet together and talk through it line-by-line. Change some of the variable names and function names to make them more descriptive. Add/remove comments where appropriate.

Independent Practice

  1. Find the JavaScript documentation online.

  2. Locate the entry for the .concat() array method. What does it do? Open a new file in REPL.it and use the .concat() method correctly on an example of your choosing.

  3. Locate the entry for the .fill() array method. What does it do? Open a new file in REPL.it and use the .fill() method correctly on an example of your choosing.

  4. Locate the entry for the .reverse() array method. What does it do? Open a new file in REPL.it and use the .reverse() method correctly on an example of your choosing.

Challenge

Locate the entry for a string method of your choice. What does it do? Open a new file in REPL.it and use the method correctly on an example you made up.

Instructor asks for a volunteer to come up to the board and write out a proper implementation of one of the array methods studied during the Independent Practice. Classmates can assist if necessary. Anyone who discovered more methods during the Challenge section may also share those with the class.

Check for Understanding

Supplemental Materials