FAQ: Introduction to Ruby - Naming Conventions

This community-built FAQ covers the “Naming Conventions” exercise from the lesson “Introduction to Ruby”.

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

Learn Ruby

FAQs on the exercise Naming Conventions

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!

hi! i am on the naming conventions! and I don’t know the script for that ! can you help me please!

Help you with what exactly?

Is Ruby your first choice of language to learn, or do you have previous programming experience?

This module wasn’t straight forward. It never showed an example of how to do what the exercise wanted you do. The exercise asks you to create a variable named eric:
issue # 1:
how do you create variable for someone who has never programmed or used Ruby before?
EX. name = “your name”

name is the variable and your name is the value that the variable will be set to store, so that when “name” is called, it will return the value “your name”

EX. puts name
will print “your name”

the exercise appears to go further than the explanation, by asking you to not only create the name variable “eric”, but it also asks that you set it to equal your name in upcase or uppercase. When I look at the solution, the answer doesn’t complete the scenario. it only creates a variable but not assign my name or change the case of the string.

what’s the correct syntax?

name = “eric”

puts name.upcase = “my name” ?

I’m not sure of how to proceed, because I don’t know enough about Ruby to perform this task.

The exercise just wants you to create a variable and assign some string value to it.
The variable is to be called name. If you do something like NAME, Name, nAme or some other variant, then you will actually end up creating a completely different variable which is not what we want. Hence, the instructions to make sure that the variable is called exactly name.

You are supposed to assign a string value to this variable. The string should be your name. “Eric” is just an example. You don’t have to use “Eric”. Suppose your name is Frodo. Then all you need to do is:
name = "Frodo"
or if you prefer
name = "frodo"
or if you prefer
name = "FRODO"

You have leeway in how you write the string representing your name, but the variable must be called name. There is no leeway there. Name, NAME etc. won’t be graded correct.

1 Like

makes sense, thanks for the clarification…Think I also misread the exercise, it says your string can be capitalized, not should. :exploding_head:


1 Like