Hacker News new | comments | show | ask | jobs | submit login

let's take a concrete example. say you want to write a ruby program to scrape some information off a website (e.g. crawl imdb and get a list of the top 100 movies and their stars). so, how would you go about it?

well, first of all you want to download a page. you haven't done in a while, so you google up the relevant ruby library (open-uri) and install it. then you load it up in a repl, like so

irb> require 'open-uri'

=> true

irb> url = 'http://www.imdb.com/title/tt0093779/'

=> "http://www.imdb.com/title/tt0093779/"

irb> page = open(url).read

# lots of html

now that you have confirmed it works, you paste it into your program

require 'open-uri'

def get_movie_html(id)

  url = "http://www.imdb.com/title/#{id}"


then just to confirm it, you go back to your repl, load your file and try

irb> page = get_movie_html('tt0093779')

you have now not only written the first part of your program, but it is available for you to use in your repl as you figure out the other bits. as you get each part working properly, extract it into a function and add it to your source code, then reload the source in your repl and continue working.

the main idea is you get very fast feedback about the specific bit of the program you are working on; the repl maintains the state of the data for you, so you can probe at it till you have ironed out the issues, and then once it is in its final form you add it to your concrete code and use it as a building block in the repl.

here's another blog post about it: http://www.davidtanzer.net/rdd_and_tests

the analogy with sketch and react is that similarly, you can design a component (say a top navigation bar) in sketch with a very fast feedback loop, and once you are satisfied with it, you reproduce it in react and then reload your sketch environment from the react file, so that from now on the navigation bar you see in sketch is the exact one you have built in code, and you can use it as a building block for the next part of the site.

Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact