Section 2 is estimated to take a total of 8-12 hours to complete. Similar to Section 1, this section of pre-work involves 📒reading, 👨🏽💻exercises, and 📝reflection questions. Make sure to manage your time well so that should you get stuck and need help, you have plenty of time to do so and meet the deadline.
This section will introduce a number of new terms, that may feel a bit more complex. Write these terms and reserved keywords in that special spot in your notebook now. Work to hold yourself acocuntable to updating definitions as you work through this section.
- if statements
- method
Using your terminal, open the local copy of the repository that you created during setup. To do this, you will need to use the terminal command cd
to change into the directory that holds the repository. Once you are in the correct directory, use the terminal command atom .
to open the prework repository. If you are having trouble with this, see the section1
instructions.
If you've made it into Section 2 of the pre-work, we hope that you've heard us say loud and clear, that asking questions is a good and important thing to do! That doesn't mean it's easy, though. Some of us have educational experiences that tell us otherwise, some of us have had bad experiences when being vulnerable and asking questions, and sometimes it's just hard to determine which words to use to formulate the question itself!
Read the three blog posts that follow:
Reflect on these posts, and how you feel about asking questions (specifically, technical questions as you enter your technical work at Turing). How might this positively or negatively impact your growth?
It's going to take some time to find that balance between googling and pushing yourself to solve a problem without hand-holding, and reaching out for help. That's ok! be patient with yourself. The way you will find that balance is by being cognizant and aware of how you currently operate. Keep this on your mind as you work through this section, and... there is no time like the present to start asking questions!
Now that you understand the importance of asking questions, read the Turing guide on asking questions to ensure that you know the best way to ask the questions you may have!
One of the most important concepts in computer programming is knowing when and how to tell the computer to do either one thing or another thing based on a set of simple criteria. We accomplish this with If-Statements and Conditionals, which you will learn about today.
When you are all done with the lessons, exercises, and questions for today, you will once again use git to save your work locally, and then send your work to Github.
Using your terminal, open your local copy of the forked repository you created during setup. To do this, you will need to use the terminal command cd
to enter the directory that holds the repository. Once you are in the correct directory, use the terminal command atom .
to open the prework repository.
-
Work through the following lessons. Any files that you create while working can be kept in today's
exercises
directory.-
What If? from Learn Ruby the Hard Way.
-
Else and If from Learn Ruby the Hard Way.
-
Making Decisions from Learn Ruby the Hard Way.
-
Conditionals from Ruby in 100 Minutes.
-
-
Work through the if_statements.rb file in the section2/exercises directory.
-
Answer the questions in the reflection.md file in the section2 directory.
-
Work through the following lessons. Any files that you create while working can be kept in today's
exercises
directory.Note: In some of these lessons, the author refers to methods as functions. They are interchangable here, but at Turing, we will be use the word
method
.-
Methods from LaunchSchool. Work up to the
obj.method or method(obj)
header. -
Intro to Methods from Learn Ruby the Hard Way.
-
Methods and Variables from Learn Ruby the Hard Way.
-
Methods and Return Values from Learn Ruby the Hard Way.
-
-
Work through the methods.rb file in the section2/exercises directory.
-
Answer the questions in the reflection.md file in the section2 directory.
Look back at that special spot in your notebook for vocabulary. Hopefully you updated it with definitions, diagrams, and code samples as you went through this section. If not, do so now. This will be part of this sections deliverables.
📝 Answer the prompts in the reflection.md
file in the section2
directory. If you need a reminder on how to format your markdown, this is the Markdown Cheatsheet!
When you are finished with all of the section2
activities, use your terminal to run the following commands in order to save your work to your local Git repository.
$ git add section2/exercises
$ git add section2/reflection.md
$ git status
- you should see only green filenames - if you see any that are red, continue togit add
those files untilgit status
shows all green files.$ git commit -m "Add Section 2 work"
You've save your work to git on your local machine, but it is not yet accessible through your remote GitHub repository. Updating our remote GitHub repository with our local changes is called pushing. Push your code with the following command:
git push origin main
You should now be able to log in to GitHub, navigate to your remote prework repository and see all the work you did in this section!