We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Clean Code

The purpose of programming paradigms like OOP is to make code easier to work with. Code that's easy for us to understand is called "clean" or "maintainable" code.

Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

-- Martin Fowler

Clean code doesn't make a program faster or more correct, but it does make bugs easier to find and future changes easier to make.

Assignment

The calculate_remaining_health function has clear names, making its bug easy to spot!

Fix calculate_remaining_health so it subtracts damage from health instead of adding it.