Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Jitli Gan
Jitli Gan
2,668 Points

Do we have to memorise all the methods of hashes?

For instance, there is like more than 1 method to determine if a specific key exists in a particular hash. It is possible to just learn one method like: hash.key?("item") ? Or do i have to learn the other methods like hash.member?("item") and hash.has_key?("item") as well?

2 Answers

I do not believe that you should have to remember every method for arrays or hash. There will be a few you use a lot whether debugging, running tests, and daily coding. It is always good to play with new methods and browse through ruby documents to know what is out there to make your life easier. In my opinion treehouse does a really good job of giving you the information you need to know and where to go if you need or want more. What I do a lot is look at other programmers code to see what methods and style they like to write in.

Short answer: No you do not have to remember the syntax for every method.

jason chan
jason chan
31,009 Points

You'll eventually will remember by practice. Feel free to google or go look for documentation to look up methods.