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

Sockets - Evelynn #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

evelynnkaplan
Copy link

@evelynnkaplan evelynnkaplan commented Feb 8, 2019

Portmanteau Generator

Congratulations! You're submitting your assignment.

Comprehension Questions

Question Answer
What went well in your code style, such as indentation, spacing, variable names, readability, etc.? What was lacking? Indentation and spacing went well in my code style. I was particularly proud of my use of the case/when syntax. It may be lacking in DRY and variable naming.
How did creating the is_vowel? method affect your project? It made the code very clean because I didn't have to repeat a long chunk of code to look for vowels in both words.
What was your strategy for getting the correct set of letters from the first word into the portmanteau? I reversed the first word (word_A) and created a counter variable called "word_A_chop." The intent of word_A_chop was to hold the index of the last letter I wanted to include in word_A (aka, where the word needed to get chopped). I put the reversed first word through the each_char loop.
What was your strategy for validating against inputs under 2 characters? I stored the user's input into a variable called word_A or word_B using gets.chomp. I then used an until loop that said "until this word's length is greater than or equal to 2," put up this error message and ask for another word. Store that word now. This loop would only break when the input's length was equal to at least 2.
In the next project, what would you change about your process? What would you keep doing? I did not realize that I am worse at asking for help than I thought. When I finally did ask for help from peers (thank you Shubha and Hana), it did unstick me. I will definitely continue to be collaborative. I will also continue to work things out on paper when necessary. Initially I wasn't working on paper but it helped me collect my thoughts.

@droberts-sea
Copy link

Portmanteau Generator

What We're Looking For

Feature Feedback
Readable code with consistent indentation mostly - see inline
Practices using variables appropriately yes
Practices using conditionals appropriately yes
Practices iteration appropriately yes
Practices using custom methods appropriately yes
Program validates against input under 2 characters yes
Takes in two inputs and creates a portmanteau yes

Great job overall! I've left a few comments inline below where things could be cleaned up, but in general I am quite happy with this submission. Keep up the hard work!

else
letter = false
end
return letter

Choose a reason for hiding this comment

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

I would probably not store the true or false value in letter, because we would expect letter to be a one-character string. Instead you could create a new variable (maybe vowel), or just return from inside the case statement.

word_A = gets.chomp
until word_A.length >= 2
puts "I'm sorry, this word is invalid. Please enter a word that is at least 2 characters long."
word_A = gets.chomp

Choose a reason for hiding this comment

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

In Ruby, we typically name variables using all lowercases letters, so this would be word_a.

word_A = gets.chomp
end
word_A_chop = 0
word_A_last = word_A.length - 1

Choose a reason for hiding this comment

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

You should use vertical whitespace (empty lines) to separate different pieces of your code, the same way you would use space to separate paragraphs in English text.

Just focusing on the section for the first word, I would probably put a blank line after lines 17, 17, and 33.

word_B = gets.chomp
until word_B.length >= 2
puts "I'm sorry, this word is invalid. Please enter a word that is at least 2 characters long."
word_B = gets.chomp

Choose a reason for hiding this comment

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

Your code to get the second word is almost exactly the same as the code to get the first word. Could you DRY this up using another method?

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