Making Code Legible Flashcards
(6 cards)
What is indentation in code?
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.
What is the purpose of blank lines in code?
To separate sections of code, making it clear where one section ends and another begins
This helps in visually organizing code for better readability.
Why is capitalization of keywords important in programming?
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.
What are sensible variable names?
Clear and descriptive names for variables that make it easier to understand what the variable represents
Example: using employeeSalary instead of es or temp.
What are comments in source code?
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.
What is prettyprint?
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.