canadalearningcode / llc-intro-to-ruby

Intro to Data Analysis with Ruby -- (SLIDES - http://ladieslearningcode.github.io/llc-intro-to-ruby/slides.html), (LEARNER FILES - http://bit.ly/llc-ruby-data) - No sample project.
Other
7 stars 10 forks source link

Style Corrections & Simplifications #18

Closed robinetmiller closed 4 years ago

robinetmiller commented 5 years ago

Note: This is based on #17, so it's actually smaller than the current diff would indicate (if that PR accepted).

Extends the work done by @ChaoticBoredom and @eddieantonio's (in #15 and #16; merged in #17) and bring the slides further into standard Ruby practices, based on our strong mutual agreements after the 2019 April 27th Edmonton session.

It also furthers the mental model simplifications started by @jleben (#14, etc) to improve learner comprehension.

  1. Error Corrections

    1. Fixed some typos
    2. Fixed some minor grammar errors in slides
    3. Fixed smarter weather (ex3) => Corrected file name reference in slides => Corrected learner prompts => In solution: Renamed variable "weather" to temperature => In solution: changed the text prompt to prompt users to enter a temperature
    4. Removed dead tutorial reference link
    5. Replaced dead gif link in Questions slide
  2. Simplifications & Consistency

    1. Made all string literals double quoted => To provide a simpler cognitive model for learners (ie. only showing one notation for strings) => Less likely learners will have errors due to contractions (eg. 'it's cold out')
    2. Renamed hello.rb to ex1_hello.rb => To create a standard file name series in the solutions
  3. Aligned code and slides with professional Ruby standards

    1. Merged PR #16 and #15 => Both of these PRs are changes to standard Ruby practices => Resolves merge conflicts in a couple files
    2. Corrected some basic Rubocop style warnings (block comments, whitespace, brackets) => To reduce as many style issues as possible and maximize learner comprehension
    3. Changed to only use puts instead of teaching both print and puts => To reduce learner conceptual model to a single style. (We had many questions on which one to use) => To reduce use of unnecessary \n characters => To conform with real-world code norms (puts is far more common)
    4. Replace for X in Y loops with #each => To adhere to standard Ruby practice => To reduce the possibility of errors (iteration variable remains defined in first style)
    5. Replaced use of word "function" with "method" => Ruby only has methods, as it is pure OO. (Methods defined outside a class are injected into Object) => Reduces conceptual model for learners (slides used to talk about both functions and methods)
eddieantonio commented 5 years ago

These are excellent changes, and I think they will simplify the workshop by a lot! 🤩Plus, it teaches pro Rubyist practices, if learners want to take their skills to the next level! 🤞🏼

Thanks for this work @robinetmiller!