Documenting Flashcards

1
Q

What should be included in the documentation of method declarations, and what is the standard notation used in Computer Science to represent variable parts of a string?

A

The documentation of method declarations should provide an overview of the functionality available through the methods and concise descriptions of how to use that functionality. This can include information on the parameters that the method expects, any return values, and any potential side effects of using the method.

In Computer Science, the standard notation used to represent variable parts of a string is to enclose them in angled brackets (<…>). For example, the string “<first><family>" can be expanded to "Markus Roggenbach" or "Randall Gaya" depending on the values used for the variables. This notation is often used in documentation to indicate that a particular part of a string can vary and needs to be replaced with an appropriate value.</family></first>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of documenting a method declaration?

A

The purpose of documenting a method declaration is to provide a clear and concise description of the method’s functionality, how the result is computed out of the parameters, and any side effects that the method may have. This information is important for other developers who may be working with the code, as well as for anyone who needs to use the method in their own programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What should be included in the description of a method’s functionality?

A

The description of a method’s functionality should be written in “natural language” and provide a clear and concise summary of what the method does. This should be accessible to non-technical users and provide a general idea of what the method is designed to accomplish.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What information should be included in the documentation of a method’s formula for computing the result?

A

The documentation for a method’s formula should provide a clear and concise explanation of how the result is computed out of the parameters. This can include any mathematical formulas or algorithms used by the method to generate the output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is it important to explain the parameters of a method in its documentation?

A

It is important to explain the parameters of a method in its documentation so that other developers and users understand how the method works and what inputs it expects. This can help to avoid errors or unexpected behavior when the method is used, and can make it easier to write code that interacts with the method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between a referentially transparent method and a method that has side effects?

A

A referentially transparent method is one that always returns the same output given the same input, and has no side effects on the rest of the program. A method with side effects, on the other hand, may modify the state of the program or have other effects beyond just returning a value. It is important to document any side effects that a method may have so that other developers and users understand how it will impact their code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a side effect in a method?

A

A side effect in a method refers to any change in the global state of a program caused by the method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can a method be considered side effect-free?

A

A method is side effect-free if it does not cause any changes to the global state of a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is an example of a side effect in a method?

A

An example of a side effect in a method is when the method modifies a global variable, thus causing a change in the overall state of the program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does it mean for a method to be referentially transparent?

A

A method is referentially transparent if its return value remains the same regardless of the program context and identical input parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Javadoc?

A

Javadoc is a document generator from Sun Microsystem for generating documentation in HTML format from Java source code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the format used by Javadoc for documenting Java classes?

A

The format used by Javadoc for documenting Java classes is called “doc comments”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Is the “doc comments” format used by Javadoc a standard for documenting Java classes?

A

Yes, the “doc comments” format used by Javadoc is the de facto industry standard for documenting Java classes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the Javadoc command?

A

The Javadoc command is used to generate HTML documentation from Java source code. The command includes options for specifying the output directory, version number, author name, and other parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some important HTML tags that can be used in Javadoc comments?

A

Some important HTML tags that can be used in Javadoc comments are @author, @version, {@code}, @param, and @return.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the @author tag do?

A

The @author tag adds an “Author” entry with the specified name-text to the generated docs when the -author option is used.

17
Q

What does the @version tag do?

A

The @version tag adds a “Version” subheading with the specified version-text to the generated docs when the -version option is used.

18
Q

What does the {@code} tag do?

A

The {@code} tag displays text in code font without interpreting the text as HTML markup or nested Javadoc tags, which enables you to use regular angle brackets (< and >) instead of the HTML entities (< and >).

19
Q

What does the @param tag do?

A

The @param tag adds a parameter with the specified parameter-name followed by the specified description to the “Parameters” section.

20
Q

What does the @return tag do?

A

The @return tag adds a “Return” section with the description text, which should describe the return type and permissible range of values. This tag is only valid in a doc comment for a method.

21
Q

What is HTML?

A

HTML is the predominant markup language for Web pages that provides a means to describe the structure of text-based information in a document.

22
Q

What is the purpose of HTML tags?

A

HTML tags are used to describe the structure of text-based information in a document.

23
Q

What is the purpose of the <p> tag?

A

The <p> tag is used to define a paragraph in HTML.

24
Q

What is the purpose of the <br></br> tag?

A

The <br></br> tag is used to insert a line break in HTML.

25
Q

What is the purpose of the <hr> tag?

A

The <hr> tag is used to insert a horizontal rule in HTML.

26
Q

What is an unordered list in HTML?

A

An unordered list is a list in HTML that starts with the <ul> tag and contains list items defined by the <li> tag.