Skip to content

Carets -- Guillermina#34

Open
murog wants to merge 18 commits into
Ada-C8:masterfrom
murog:master
Open

Carets -- Guillermina#34
murog wants to merge 18 commits into
Ada-C8:masterfrom
murog:master

Conversation

@murog

@murog murog commented Nov 17, 2017

Copy link
Copy Markdown

JS Scrabble

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What patterns were you able to use from your Ruby knowledge to apply to JavaScript? Objects! Coming from Ruby, it was really difficult for me to wrap my head around how to solve problems using javascript at first. It wasn't immediately clear to me how javascript could be object oriented. However, the project made much more sense once I figured out how to properly break things down to classes, class functions and helper functions.
What was a challenge you were able to overcome on this assignment? The first time I attempted highestScoringWord, my solution was really long. I also initially struggled on how to keep track of a word's index and score in a way that was easily readable. Creating a word class, in which every instance of a word knew its own score, made everything much more manageable. Storing instances of word objects for players made the player methods more manageable as well.
What is your favorite thing about learning a new programming language? Thinking through design patterns! The brute force solutions that I first attempted involved lots of nested loops and conditionals. I realized that I was defaulting to this because I wasn't familiar with exactly what is being returned or where. Once I started playing with different functions, I was able to create something much more readable. Also, learning how to debug was very fun!
What is your least favorite thing about learning a new programming language? NaN doesn't equal NaN...
Do you have any recommendations on how we could improve this project for the next cohort? I think this was fine as is.

@tildeee

tildeee commented Nov 27, 2017

Copy link
Copy Markdown

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene x
Comprehension questions :) ! x
General
score calculates score, has appropriate params and return value x
highestScoreFrom calculates highest scoring word, has appropriate params and return value x
Player object
Has name and plays properties x
Has play, totalScore, hasWon functions
Has highestScoringWord and highestWordScore functions
Overall

I'm really glad to read about your journey refactoring through your comprehension questions! I'm wondering why you went with the approach you did with nested for loops in the score method.

I like the Word class! Unnecessary for this problem, but still very clean.

I love the sorting (and custom sorting function) you did for highestScoreFrom

For the Scrabble.Player class, instead of wrapping the assignments in the constructor in the if that runs the validation/throws the exception, it may be better to write code like this instead:

constructor(name) {
  Scrabble.Player._isValidName(name)
  this.name = name;
  this.plays = [];
  this.words = [];
}

I'll make the same suggestion for Scrabble.Player's play(word) method. If you need to catch a condition just for one line, consider making it a check that returns out in one line:

play(word) {
  if (this.hasWon()) { return false; }
  const playedWord = new Scrabble.Word(word);
  ...
  return playedWord.word;
}

Nice use of reduce()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants