Previous Module
Next Module

COMPUTER SYSTEMS: Encoding and compression

COMPUTER SYSTEMS: Network topologies

COMPUTER SYSTEMS: Wired and wireless networks, protocols, and layers

COMPUTER SYSTEMS: Threats to computer systems and networks

COMPUTER SYSTEMS: Operating systems and utility software

ALGORITHMS AND PROGRAMMING: Types of data

ALGORITHMS AND PROGRAMMING: Producing robust programs

ALGORITHMS AND PROGRAMMING: Designing, creating, and refining algorithms

  • Maintainable code is easy to read, update, and debug – even by someone else.
  • Use of subprograms:
    • Break code into functions or procedures.
    • Each does one clear task. 
    • Makes the code reusable and easier to test.

def get_user_input():

name = input(“Enter your name:”)

return name

  • Naming conventions:
    • Use meaningful names for:
      • Variables (user_name, total_score)
      • Subprograms (calculate_tax, check_password)
    • Avoid: x, abc, thing1 (unless used temporarily or in loops).
  • Indentation:
    • Shows which code belongs inside loops, conditions, or subprograms.
    • Python requires indentation (usually 4 spaces).
    • Helps with logic clarity and avoiding syntax errors.

if score > 10:

print(“High score”)

  • Commenting:
    • Comments explain the code, especially what it does and why something was done a certain way.
    • Good comments help other programmers (and your future self).

# To calculate total price with tax

def calculate_total(price):

return price * 1.2

Unlock Maintainability

Subscribe to SnapRevise+ to get immediate access to the rest of this resource.

Premium accounts get immediate access to this resource.

Previous Module
Next Module