Removing Excess Code Lab
Learning Goals
- Separate used and unused variables
- Interpret existing functions to derive purpose
- Modify expressions and statements while maintaining functionality
Instructions
In this lesson we're going to practice spotting anti-patterns and tidying up code.
Apply the flatiron process to help you unravel the code in code_examples.rb
This labs tests will be slightly different than the usual. The first test will be to see if the code works and will be passing when students start the lab. The challenge instead is to clean up enough of the code while keeping the code working. Reduce specific methods to fewer lines of code. Remove a certain amount of if
statements. Remove specific extra steps or variables that encourage
the student to find a better way of writing the code.