-
Notifications
You must be signed in to change notification settings - Fork 66
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
Aleisha Mork #71
base: main
Are you sure you want to change the base?
Aleisha Mork #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on this @aleish-m. I can tell you have a solid understanding of Ruby syntax, datatypes, and conventions. Please see my comments and I would encourage you to adjust anything that should be fixed.
|
||
# 1: gets.chomp - | ||
# gets - Pauses the program to get input from the user | ||
#. chomp - removes the 'enter' (aka new line) character that was entered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
|
||
3. What character is used to indicate comments in a ruby file? | ||
- `#` - the hash is the first character of the line for a comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to call this the 'pound sign' instead since 'hash' can also more commonly refer to a datatype in Ruby.
@@ -1,15 +1,67 @@ | |||
## Section 2 Reflection | |||
|
|||
1. What are two points from the Growth Mindset article and/or video that either resonated with you, or were brand new to you? | |||
- You can be growth mindset in some areas of your life and fixed mindset in others. Try to acknowledge which part in your life are which so that you can work on making all part of your life growth mindset areas. You can learn anything **if** you *want* to learn it. | |||
- Don’t go in to panic mode when you hit a struggle. Panic mode usually will put you in to a fixed mindset mode. Instead, pause and accept that you are struggling and evaluate the struggle you are having Determine what steps you need to take and what specific things you need to learn or practice in order to overcome this struggle. And remember, somedays will just be a struggle and you might just need to recognize you are struggling and its a bad day. Its ok to walk away clear your mind and come back later ready to grow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@@ -40,21 +43,24 @@ | |||
# value should be some appropriate value for that key. Work to have at least 5 key-value pairs. | |||
|
|||
# Write code that prints your email hash to the terminal. | |||
contacts = {Trevor: '[email protected]', Janet: '[email protected]', Ceclia: '[email protected]'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is Ruby convention to NOT capitalize the keys. These should be snake_case.
puts "#{state} is abbreviated #{abbrev}" | ||
``` | ||
|
||
* Why are we able to name the keys and values whatever we want here using `||`? Can this be used at any point to name the keys and values or only with specific methods? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ||
is called a block and the things inside of them are called "block variables". I'd encourage you to research these terms for your answer.
- A hash could be used when storing user profile data (eg: name, age, member since, etc.). It has multiple data points that you would want to reference. It would be better than an Array because it is how the data relates to each other that matters. Not what order that data is stored in and in a hash you can give more meaning to what pieces of data represent. | ||
|
||
8. What questions do you still have about hashes? | ||
* In the ruby documentation they reference using `@auther = author` in "Hash Keys" I did not understand this section or what the `@` signs were doing. Is this adding items to the Hash, somehow? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is called an instance variable. You will use them more once you start learning about attributes.
end | ||
``` | ||
|
||
* The `!value` was not in the ruby documentation or Ruby in 100 as far as I could tell is this just a different way of doing `grades.default = 0` per the ruby documentation? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To figure this out, I'd encourage you to run this code and see if you get the same output. If it's different outputs, then you know that these 2 blocks of code perform different things.
Here is my Mod 0 Project / Mod 1 Pre-work!