mediumMultiple Choice
FC0-U71 Practice Question: Which coding best practice improves code…
Which coding best practice improves code readability and maintainability?
⚠ Common exam trap
A common misconception is that using global variables simplifies data sharing or that hard-coding values makes code faster. In reality, these practices severely degrade maintainability and are universally discouraged in professional software development.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Using meaningful variable names
Using meaningful variable names (option B) is a core coding best practice because it makes the code self-documenting, allowing other developers (or the original author after time) to quickly understand the purpose of each variable without needing extensive comments. This directly improves both readability and maintainability, as changes can be made with lower risk of misinterpretation. In contrast, practices like using global variables or hard-coding values obscure logic and create dependencies that are difficult to manage.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Using global variables for all data
Why it's wrong here
Global variables expose state to every function, creating hidden coupling and making data flow hard to trace, which harms maintainability. They are tempting for quick sharing of values across modules, and would suit small scripts or configuration constants, but the question asks for readability-enhancing practice such as local scoping.
- ✓
Using meaningful variable names
Why this is correct
Descriptive identifiers such as customerTotal or calculateTax let other developers infer a variable's purpose without tracing its assignments, directly improving readability. Because intent stays visible, later modifications are safer and faster, satisfying the maintainability requirement in the stem.
- ✗
Hard-coding values whenever possible
Why it's wrong here
Hard-coded values scatter magic numbers and strings throughout code, so any change requires editing many sites and risks inconsistency. It tempts for speed in prototypes or fixed constants, but the practice sought is extracting values into named constants or configuration, improving readability and maintainability.
- ✗
Writing long, single functions
Why it's wrong here
Long single functions bundle unrelated logic, forcing readers to trace many branches and complicating testing and change. They tempt because they avoid parameter passing and keep everything visible in one place, which can suit short throwaway scripts, but the practice sought is decomposing code into small, single-purpose functions.
Go deeper
Related to this question
About these practice questions
Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.