Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How I Explained REST to My Wife (2004) (tomayko.com)
115 points by bugBunny on March 11, 2013 | hide | past | favorite | 51 comments


I can't stand the "blog post as conversation" format. It's fine if you're quoting a conversation for one or two paragraphs, but for something this long you should do me (the reader) the courtesy of speaking directly to me.

Also this is giving way too much credit for the creation of the URL. The format of the URL is not some miracle, genius insight. It is a natural result of network computing, and similar descriptors of how to find a file on a remote system had existed previously for ages.


This is an example of a Socratic Dialog[1], and relies on metaphor. It's in that way a piece of art useful as a teaching tool, but as such it trades some precision for the end effect.

1. http://en.wikipedia.org/wiki/Socratic_dialogue


This is condescending, and relies on the assumption that I don't know anything about anything and just fell off the turnip truck last week.

I think something would have to be done with a bit more art and skill before I would consider it Socratic dialogue. This is just a clumsy blog post that is annoying to read, IMHO.


>This is condescending, and relies on the assumption that I don't know anything about anything and just fell off the turnip truck last week.

Well, obviously you didn't get it.

> but for something this long you should do me (the reader) the courtesy of speaking directly to me.

Your comment is also full of pointless vitriol.

I think it's one of the most succinct and well done explanations of an abstract academese concept loads of people quote but few people seem to understand. I refer to this blog post often.


You sound upset. Chill out, buddy.


Oh, me? I'm perfectly calm. I didn't want to sound too condescending.


> This is condescending, and relies on the assumption that I don't know anything about anything and just fell off the turnip truck last week.

I would not overlook the possibility that they were just excited to formally reference something called "Socratic dialogue". It seems we like finding formal names for things on HN.


If only there was a formal name for that behavior.


> This is condescending, and relies on the assumption that I don't know anything about anything and just fell off the turnip truck last week.

The blog post is from 2004 -- about nine years ago -- a time when there really wasn't much information about REST out there aside from Roy Fielding's dissertation. I recall reading this essay a few years later during my own what-the-heck-is-this-REST-thing-all-about phase and finding it relatively helpful.

If he'd just published this blog post today your criticism would have a lot more merit.


I don't know anything about Socrates but I sometimes find that internalising an idiot who doesn't know anything and then trying to explain my ideas to them (sometimes whilst walking round in circles audibly talking to myself) is a useful thought process.


Sure, that's a great technique. But IMHO, don't write down the conversation as it occurs in your head. Spend the time filtering it into a more readable article.


It seems natural in retrospect, but it actually took a surprisingly long time to invent. The URL didn't exist until 1990; people had been putting files on FTP sites since 1973 or so, 27 years at that point, and there wasn't even a standard piece of software which, given "wuarchive.wustl.edu:/foo/bar/baz.txt", would give you the contents of baz.txt. (ncftp supported that by 1994, IIRC, but no vendor shipped ncftp as standard.)

Obviously it wasn't that people couldn't figure out how to do that. It's that nobody understood that it was an important thing to be able to do. It seems really obvious in retrospect, but it wasn't.

Today, there still are a surprising number of people who create network-accessible persistent objects without making them URL-addressable. Apparently it's still not obvious to everyone that it's an important thing to be able to do.

Rohit Khare's article, "Who Killed Gopher?", helps to make the history a little clearer: http://www.ics.uci.edu/~rohit/IEEE-L7-http-gopher.html


rcp came out with 4.2BSD in 1983.

rcp somemachine:/some/folders/somefile.txt

Is remarkably similar to:

http://somemachine/some/folders/somefile.txt

Don't get me wrong. The Web is one of the most important developments in the history of computing, or even of mankind.

But like I said, the original article makes the URL out to be some unique, genius invention that came out of nowhere. When in reality it evolved very naturally out of existing network computing practices.

Here's the clue that the article is wrong; when URLs came on the scene everybody who was using the internet at that time understood them intuitively. That's because they were a natural evolution of what was already there.

Of course, that's usually the case with just about anything people say is revolutionary and came out of nowhere. If you look at the actual context that the thing came from, there's a completely logical progression. It only seems like it came out of nowhere to people who weren't there.


It's a great blog post, but it has been posted numerous times on HN. I don't want to rant or anything, but I think we should start searching before posting. Please correct me, if I am wrong.

cheers http://news.ycombinator.com/item?id=763570 http://news.ycombinator.com/item?id=3396910 http://news.ycombinator.com/item?id=5186774


This is very meta, but what I find infinitely more annoying is this trend of people who love to repost their own comments 10 times in 10 different threads loosely related to the same issue. We should start punishing instead of rewarding that. I'm looking at you, tokenadult.

At least with link repetition I can quickly see whether I already read this and decide to ignore it. But re-posting an old, cancerously-grown comment with a new first paragraph is just mean and lazy.


For what it is worth I've been an HN member nearly four years and I've never seen this before. I enjoyed it and up voted. I don't think reposts are necessarily a bad thing because there is always going to be new members who have not seen the item yet, or old members who were "in the zone" coding instead of wasting time browsing HN on the day the item was last posted.


Even if it were reposted within a month, a considerable number of people would have never seen it before. It's just the nature of these boards.

Just rely on the upvoting system. If people think it is relevant, they upvote. This means things will only show up on the front page if enough people are interested (ie it has been long enough since it was last posted).


well, sorry. It was shocking good and never seen b4 for me. But, it's so good that I would like to read it again in a year or so :)


... what?


?


Is the duplicate posting issue relevant if the post is receiving up votes?


Interesting, all of these have identical links. Usually Hacker News doesn't let you post the same link more than once.


> Usually Hacker News doesn't let you post the same link more than once.

I believe that's wrong. From what I've seen, I think that that time is also a factor. After some amount of time, you can repost things with exactly the same link and title. And I believe that it's deliberate (the posts are likely to be new to many people since the population turns over to some degree after x amount of time).


And that time period might be at most a month, considering the last post with the exact same link (http://news.ycombinator.com/item?id=5186774 ) predates the current post by 31 days.


Is this true? It sounds like an opportunity for karma bots to re-post popular posts from the past.


So Ryan Tomayko's conversions with his wife are akin in tone and style to a language textbook aimed at tweens?


Better than the equivalent conversation in our house.

Me: Hey, do you want to learn about a core principle of how the Web works? ;; Her: Huh? ;; Me: You know, the thing Facebook runs on. ;; Her: Oh right. No then.

It's lucky there are more interesting things than technology for us to talk about, thankfully! :-)


I had that thought, too.

I don't think that exact conversation actually took place. My girlfriend would give me hell if I talked to her like that, I'm pretty certain.

As for the explanation, I like it. It puts into words what I had been intuitively thinking about the benefits of a RESTful API.


What do you think about the separation of Web sites and Web services (so-called APIs)? Shouldn't the Web site be the Web service, and offer multiple representations of its endpoints?

As a trivial example, consider that I have a blog located at the URIL http://www.example.org/posts/

If I were to offer an API to other developers, I would have two options: 1) serve posts as `application/json` at the URI http://www.example.org/api/v1/posts ; 2) serve both `text/html` and a `application/json` representations at the same URI http://www.example.org/posts , handling the desired mime-type and API version in the 'Accept' field of the HTTP request.

Which approach is better?


Yes, and we also have XML, the Academically Correct and proven-in-the-field way to represent all entities.

I get the "URLs are nouns" metaphor, but I don't think it needs any additional promotion or particularly favors HTTP over whatever else might emerge.


Better yet, RDF. It's the final solution for data representation.


Correct me if I am wrong here. So, instead of the eloquent method of using GET, POST and PUT on resources, the current practice is about the programmer writing custom parsers to get the information they want and then use them accordingly.


Isn't representation of resources what the semantic web is supposed to be about? if I wanted to make someone understand the semantic web I would say something like this,

ontologies are data with corresponding metadata about everything on a domain or site.

These ontologies allow the data to be parsed automatically, i.e sites like amazon could just make their data available as ontologies and third party sites could "read through the sites for us". These third party sites serve as a portal from where we could ask for what we want and they would in turn look through the sites available (eBay, amazon etc) using the ontologies and get the best deal for us.


Yes it's a classic. Supplemental to RFC 2616.


most of explaining REST to my wife was linking her fielding's thesis. Pretty happy with my life... :]


He uses four metaphors to help explain this:

1. Cleaning 2. A coffee table 3. Shopping 4. A school

So was he explaining this to his wife in the 1970s? Because REST over HTTP didn't even exist until the 90s.


> Wife: You mean "http" like the beginning of what I type into the browser?

What browser does she use? It wasn't required to type that anymore for ages already :)


For what it's worth, this post is from 2004. Even with that in mind, this is not a verbatim conversation; the style is Socratic inquiry.


Two points: One, the post is from 2004, so maybe she could remember a time when typing that was required (I wouldn't know - I was too young to be using the internet at that time).

Second, this conversation seems to have been "enhanced" for the sake of the blog post, so it's quite possible that all the details aren't 100% accurate. Some of her questions seem a tad too convenient.


The article was written in 2004, but even today, a lot of advertisements, name cards, and other types of printed material still contain URLs that begin with http and www. As a result, some people still type in all those characters when they want to look up a web site. In fact, this practice might be more common among non-tech-savvy people (such as the wife in this story) than among HNers (who know which parts of a URL are optional).


I don't think it was ever required (even when it was shown), but people still typed it.


I don't wish to read essays but i guess it is just a way to transmitt information on web, get and post methods, mainly.


Nope, REST can apply to any channels, not just the web.


What a bunch of hogwash. Everything does not fit into the request/response model of HTTP and the Internet is certainly the web.


Email (not webmail, but IMAP and POP etc) uses the internet but is not part of the web. There are other examples but I think that's the easiest to see.


"The web" isn't exactly a well-defined concept. There's a school of thought in which anything with a URI is part of the web.


Emails don't have URIs. My email boxes don't have URIs. My main problem is that there's no way to link emails together, so they're not really part of any web.


Does mailto:person@example.com not count as a URI to your mailbox?


I meant /Inbox, /Trash, /Spam etc.


"...the internet is certainly the web" sounds like religion to me.

A highway is a type of road. As are streets, byways, lanes, courts etc... URLs need not be protocol specific, but having a standard makes inter-protocol communication that much simpler. In fact the post was primarily about how we label things (nouns, verbs etc...). I'd say most things fit the model of giving, taking and changing things, no?


I meant to say the internet is NOT the web...as in not HTTP.




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

Search: