Git Product home page Git Product logo

yield-and-blocks-prework's People

Contributors

annjohn avatar deniznida avatar dougtebay avatar febbraiod avatar franknowinski avatar gj avatar jmburges avatar joll59 avatar lukegrecki avatar octosteve avatar onyoo avatar pickledyamsman avatar ruchiramani avatar sgharms avatar shmulim avatar sophiedebenedetto avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yield-and-blocks-prework's Issues

This lab could benefit from 1) a clearer "why" and 2) illustrations to clarify its abstract concepts

Two things:

  1. It took me a while to understand the point of yield from this. As I understand it, it's to allow us to build an abstract method into which you can push blocks of code, meaning the same method could give different results -- e.g. a hello method you can call for different starting letters:
hello(["Tim","Tom","Jim"]) do |name|
  if name.start_with?("T")
    puts "Hi, #{name}"
  end
end

hello(["Tim","Tom","Jim"]) do |name|
  if name.start_with?("J")
    puts "Hi, #{name}"
  end
end

This is not clear from the lab, and I think explaining it would help greatly. Until I realized this I wasn't clear on why yield was better than just writing the if statement inside the while loop.

  1. The concept of yield and blocks could be clarified with labeled illustrations. This is a relatively abstract idea, and multiple modes of explanation would be useful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.