FAQ: Hashes and Symbols - The Hash Rocket Has Landed

This community-built FAQ covers the “The Hash Rocket Has Landed” exercise from the lesson “Hashes and Symbols”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Ruby

FAQs on the exercise The Hash Rocket Has Landed

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Why were we taught how to do it the old way if it was obsolete anyway? Maybe I’m just salty because it took me a while, but why learn it?

1 Like

Hello, @jonrysdam3461137005.

It’s always good to know the ‘old’ way because you are likely to see it when viewing older code. Programming often involves reviewing code you didn’t write yourself.

1 Like

I would think that it would make more sense to teach the older notation later, because the first one taught is usually the one that sticks (up to a certain level of experience and/or time). Also, as time passes, wouldn’t the rocketless syntax become more common due to being easier to type?

I have another question - in Ruby 1.9, I believe that the rocket still worked. Does it still work in the latest versions of Ruby?

1 Like

I have nothing whatsoever to do with the curriculum of any CC course, so I was only offering a plausible reason for teaching the ‘rocket’ syntax. I don’t know if the latest version of Ruby still accepts ‘rocket’ syntax, but I suspect it is still valid. I just did a quick test on repl.it which uses version 2.5.5p157, and it works. Like you said, there’s no real reason to use it going forward, but it’s good to be able to recognize what it is if you come across it.

movies = {London_calling: " I love histories", Blue_lagon: “To young” }

#no more colons at the beginning and no more hash rockets also

The ‘Old’ way is needed when using a key which is not a symbol.

i.e. colons at the end only works when the key is a symbol. So if you’re using a String, integer, etc as the key you still need to put “key” => value

N.B there is nothing in the Codeacademy lesson which suggests this, you have to google around it