This workshop is important because:
The Ruby Programming Language is written to be as close to the natural English language as possible. To properly code in Ruby we should abandon our previous structures and explore the 'ease' of Ruby Idioms.
After this workshop, developers will be able to:
- Discuss the proper usage of Ruby methods and syntax
- Compare and contrast the difference between a
Javascript
way andRuby
way of approaching a problem - Create methods that demonstrate best practices and efficient code.
Before this workshop, developers should already be able to:
- Synthesize basic
Ruby
statements - Understand the various data types in
Ruby
- Navigate and execute live code in
irb
,pry
, or a.rb
file.
Idiomatic is the concept of using, containing, or denoting expressions that are natural to a native speaker. Idiomatic programming means that your program contains statements that are unique to the language; i.e., you actually use the expressive power (or lack thereof – PHP) of the language in your programs.
Ruby takes advantage of having language-specific expressions and methods. The more comfortable you are with built-in features, the more succinct and self-documenting your codebase will become.
Navigate to our class Google Drive folder and create Ruby methods for each problem. You will be coding as a table group. Once your method achieves the provided input/output goals, submit your group's code in the appropriate space. Try to keep it short and sweet!
- Returning implicitly is now a thing
- Return early and return often
- Check if a helper method exists before creating one
- Ruby has many built-in methods available to us.