Skip to content
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

LONDON | Pooriya Ketabi | Module-Structuring-and-Testing-Data | Sprint 3 #230

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

PooriyaKTB
Copy link

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 COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@PooriyaKTB PooriyaKTB added the Needs Review Participant to add when requesting review label Dec 16, 2024
@Sslim123 Sslim123 added 👀 Review Git Changes requested to do with Git 👀 Review Requirements Changes requested to meet requirements and removed Needs Review Participant to add when requesting review 👀 Review Git Changes requested to do with Git labels Dec 16, 2024
@illicitonion illicitonion added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Dec 20, 2024
Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

This is looking really good!

Don't forget to do the playing computer exercise in the investigate folder.

Comment on lines 35 to 36
if (parseInt(rank) >= 2 && parseInt(rank) <= 10) {
return parseInt(rank);
Copy link
Member

Choose a reason for hiding this comment

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

You're calling parseInt on the same input here three times - can you think how you can avoid needing to repeat this? Why is doing the same thing three times not ideal?

Copy link
Author

Choose a reason for hiding this comment

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

It's not ideal, because of performance and readability (debugging). Therefore it's better to store it in a variable and then use the variable instead.
Thank you for mentioning it.

Copy link
Member

Choose a reason for hiding this comment

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

These are some really nice tests, good job!

Copy link
Author

Choose a reason for hiding this comment

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

Thank you. I'm glad you found it nice.

// ---------------------------------------- Tests: ----------------------------------------
// -------- Proper Fraction --------
console.assert(
isProperFraction(2, 3) === true,
Copy link
Member

Choose a reason for hiding this comment

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

We actually don't need to put === true or === false in assertions. What we need is an expression which evaluates to a boolean (true or false), and isProperFraction already returns a boolean, so we can remove the === true (and write !isProperFraction(...) where we want to check something is false.

Almost always, writing something === true or something === false should be replaced by just something or !something :)

Copy link
Author

Choose a reason for hiding this comment

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

I truly appreciate your detailed explanations. Your guidance has been really helpful, and I’ve made the necessary changes accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

Ideally this directory wouldn't be included in your coursework PR, as this was just your local work during the prep, rather than the exercises you're submitting for review.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for pointing that out.

@illicitonion illicitonion added Reviewed Volunteer to add when completing a review and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Dec 20, 2024
@PooriyaKTB PooriyaKTB added the Complete Participant to add when work is complete and review comments have been addressed label Dec 28, 2024
Copy link
Member

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Looking really good!

Comment on lines +34 to +35
let rank = card.slice(0, -1);
const parseIntRank = parseInt(rank);
Copy link
Member

Choose a reason for hiding this comment

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

It's useful to differentiate variable names when you have two things which have the same (but for some reason different, e.g. a different type type) data in them.

I probably wouldn't use parseIntRank as a variable name - parse is a verb, and verbs suggest doing (i.e. function names).

What do you think of each of these variable name pairs?

rankString and rankNumber

rankAsString and rankAsNumber

stringRank and numericRank

rankString and rank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Participant to add when work is complete and review comments have been addressed 👀 Review Requirements Changes requested to meet requirements Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants