Skip to content

Conversation

sernamalala
Copy link

Learners, PR Template

Self checklist

  • [y] I have committed my files one by one, on purpose, and for a reason
  • [y] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • [y] I have tested my changes
  • [y] My changes follow the style guide
  • [y] My changes meet the requirements of this task

Changelist

Briefly explain your PR.

I have completed all the exercises, I have implemented functions as required according to the conditions given and I have also created test files for these functions by using Jest.

Questions

Regarding commenting in the test function, how descriptive should they be?

Ask any questions you have for your reviewer.

…emove my console.log tests when running the tests. I did that and I did not get any more errors
…and was able to implement a working solution
…and was able to implement a working solution
…to give some more unique tests like usinng the numbers within strings
…y test code into GPT without changing it to give me better descriptions for the test cases'
@sernamalala sernamalala added the 📅 Sprint 3 Assigned during Sprint 3 of this module label Nov 26, 2024
@sernamalala sernamalala added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 26, 2024
@cjyuan cjyuan self-requested a review December 1, 2024 21:14
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left comments and suggestions in the code.

@cjyuan
Copy link
Contributor

cjyuan commented Dec 1, 2024

Regarding your question, "Regarding commenting in the test function, how descriptive should they be?"

Write it in such a way that

  • You think another programmer (i.e., PR reviewer) would understand
  • You would still understand what you wrote after revisiting your code 6 months from now.

I personally prefer concise description. Complete sentence is not needed.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Dec 1, 2024
@sernamalala
Copy link
Author

Hi @cjyuan I've looked at your review comments and I've adjusted those that I could. I left some questions for the comments I found a bit more difficult to understand.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using multiple if/else consider using switch statements

https://www.w3schools.com/js/js_switch.asp

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @KudahShambare I am only seeing your review now. I already responded to CJ's review

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you handling the equal denominator and equal numerator scenario?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it passing all the tests?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when arranging your code in if statements, consider following either an ascending/descending (depending with the situation) pattern. In this case you are starting with 0, then negative numbers then finally positive numbers. This order of your statements affects how the code is executed. For example if num is -7, firstly its going to compare if its equal to 0 and then continues to check if it's less than 0 (Here it will throw an error. If we swap the conditions it will just throw an error without even running the equality test -- saving time)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/62150130/algorithm-of-checking-if-the-number-is-prime

Refer to the discussion in the link above. For large numbers, your implementation of the algorithm will be very slow.

@sernamalala sernamalala added the Complete Volunteer to add when work is complete and all review comments have been addressed. label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed. Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TECH ED] Complete Sprint 3 exercises

4 participants