Making Code Legible Flashcards

(6 cards)

1
Q

What is indentation in code?

A

Adding spaces or tabs at the beginning of code lines to visually represent the structure of the code

Indentation shows how code blocks are related to each other.

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

What is the purpose of blank lines in code?

A

To separate sections of code, making it clear where one section ends and another begins

This helps in visually organizing code for better readability.

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

Why is capitalization of keywords important in programming?

A

In case-sensitive programming languages, correct capitalization is essential; it helps distinguish keywords from variables even in non-case-sensitive languages

Following conventions enhances code clarity.

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

What are sensible variable names?

A

Clear and descriptive names for variables that make it easier to understand what the variable represents

Example: using employeeSalary instead of es or temp.

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

What are comments in source code?

A

Annotations that explain what the code is doing and are not executed as part of the program

Comments are crucial for maintaining code and making it understandable.

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

What is prettyprint?

A

The stylized display of source code with visual styling such as syntax highlighting, proper indentation, and color-coded elements

This makes code more readable based on the language syntax.

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