Skip to content

Instantly share code, notes, and snippets.

View maryrosecook's full-sized avatar

Mary Rose Cook maryrosecook

View GitHub Profile

Responding to a student's request for help

Process

  1. Map the student's request for help to one of the underlying problems listed below.

  2. Apply one of the suggested solutions.

  3. Ask the student for feedback on your help.

OVERVIEW OF THE WEEK
- Encapsulating Single Responsibilities (rather than just common behaviour) into classes
- makes code easy to reuse
- makes code easy to change
- makes code easy to understand
- Refactoring code for SRP
- Adopt this code writing process
# Use test-driven development to write a method that:
# * Takes an array of numbers.
# * Returns an array of the same numbers, except each number has had 1 added to it.
# * e.g.
# * Input: [1, 2, 3, 4, 5]
# * Return: [2, 3, 4, 5, 6]
# * Make sure to create a separate project directory for your code.
# Use test-driven development to write a method that:
# * Takes an array of numbers.
# * Returns the sum of the numbers in the array.
# * e.g.
# * Input: [1, 2, 3, 4, 5]
# * Return: 15
# * Make sure to create a separate project directory for your code.