Skip to content

Northwest | May-2025 | Sofayas Solomon | Sprint 2 #658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sofayas
Copy link

@sofayas sofayas commented Jul 15, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

This pull request covers all Sprint-2 prep exercises, including the following main tasks:

Errors

Reviewed multiple error files in the errors directory

Predicted the errors before running the code

Interpreted the error messages and explained why they occur

Gained experience debugging common JavaScript errors like syntax errors and variable redeclarations

Debug

Analyzed several buggy programs in the debug folder

Predicted why each program did not behave as intended

Ran and verified these predictions in Node.js

Corrected the code to fix bugs such as wrong function parameters and missing returns

Implement

Built functions based on specific requirements:

Calculated BMI with calculateBMI(weight, height)

Converted strings to UPPER_SNAKE_CASE

Created a reusable toPounds function

Tested these functions against multiple input cases to ensure correctness

Interpret

Read and interpreted larger code examples with unfamiliar syntax or functions

Used MDN and other documentation to understand JavaScript methods and behaviors

Employed console.log for variable inspection and debugging

Extend

Extended the 24-hour to 12-hour clock conversion function (formatAs12HourClock)

Wrote multiple tests covering groups of inputs and edge cases (e.g., "00:00", "12:00", "13:00", times with minutes)

Fixed bugs found during testing to make the function robust and accurate

Questions

In the section where we refactor the formatAs12HourClock function, I understand why we create a variable for the hours to avoid repetition. But how do I decide when it’s important to refactor like this in larger programs? Are there best practices or guidelines to know when and how often to refactor for readability and performance?

@sofayas sofayas added the Needs Review Participant to add when requesting review label Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review Participant to add when requesting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant