Multiple choice technology programming languages

Which of the following is the best way to write reusable code that is easier to maintain?

  1. Use more global variables

  2. Keep variable and function names down to one or two letters

  3. Insert comments throughout your source code files

  4. Use pointer arithmetic wherever possible

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Comments improve code maintainability by explaining intent, complex logic, and design decisions. Options A (global variables), B (short names), and D (pointer arithmetic) are widely recognized as anti-patterns that hurt reusability and maintainability.