Ruby Master Class Christina Thompson @Xtina_Starr [email protected].
-
Upload
abraham-mccoy -
Category
Documents
-
view
212 -
download
0
Transcript of Ruby Master Class Christina Thompson @Xtina_Starr [email protected].
![Page 2: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/2.jpg)
Intro
• Learning to code with Skillcrush• Found a new passion…Now what?• Ada
![Page 3: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/3.jpg)
Why I love
• Beginner Friendly• It’s Flexible• The Community• Rails
![Page 4: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/4.jpg)
The Struggles of Learning
• Learning your first programming language is really hard!– It’s abstract and not really natural.
• Git, Ruby, and the Ruby Docs are magic, but I promise it “gits” better!
![Page 5: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/5.jpg)
When It Started to Click
• The HTTP Request Cycle
![Page 6: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/6.jpg)
Understanding the HTTP Request Cycle
• Helped focus on a particular state.• State – all of the stored information (e.g.
methods and variables) at a given instances in time that a program has access to.
![Page 7: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/7.jpg)
State
![Page 8: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/8.jpg)
Ask the Right Questions
• What methods and variables are available in a particular state?– Tip: to figure out what methods are available to an
object you can call .methods on it• What type of object are you working with?• What a method is called on an object what
value is return?
![Page 9: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/9.jpg)
Debugging
• SyntaxError - Raised when encountering Ruby code with an invalid syntax.– [1, 2, 3, 4].delete(2
• TypeError - Raised when encountering an object that is not of the expected type.– [1, 2, 3].first(“two”)
• NameError - Raised when a given name is invalid or undefined.– string.chomp
• ArgumentErrors - Raised when the arguments are wrong and there isn't a more specific Exception class.– [1, 2, 3, 4].delete
![Page 10: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/10.jpg)
Debugging
• Using puts and inspect• Better Errors Gem
![Page 11: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/11.jpg)
Getting Better At Ruby
• Practice practice practice• Being patient it will come• Reading other people's code• Explaining your code to others• Solving problems like FizzBuzz in different
ways• Asking questions• Being fearless
![Page 12: Ruby Master Class Christina Thompson @Xtina_Starr c.thompsonms@gmail.com.](https://reader036.fdocuments.net/reader036/viewer/2022083009/5697bf7c1a28abf838c83fa7/html5/thumbnails/12.jpg)
Resources
• Ruby Docs• RubyMonk (tutorial)• Git Immersion (tutorial)• Stack Overflow• Learn to Program - The Facets of Ruby Series by
Chris Pine (book)• Computer Science Basics in Ruby (book)• The Ruby Style Guide• Google :-)