Agreed. Different clients should get different views. I don't think we're that far off from having to support the js-light "web crawler" view, although we already have the tools to make this really easy.
1,745 karma · joined August 26, 2008
Previously: Software engineer and manager at Facebook, Asana, and Meebo
Agreed. Different clients should get different views. I don't think we're that far off from having to support the js-light "web crawler" view, although we already have the tools to make this really easy.
There are plenty of templating engines that have been ported to Javascript. Mustache is the first example that comes to mind: http://mustache.github.com/
Once you have the templating engine the rest of the logic is pretty easy to build.
Rendering web apps entirely on the client in general is pretty awesome although there are two problems: 1) the push state API is not supported in all browsers yet, which forces you to resort the fragment identifier + onhashchange to approximate the same functionality. And of course the fragment identifier only affords you a fraction of the same luxuries as the push state API. And of course onhashchange is not supported in older browsers. 2) When you fall back to the fragment identifier rendering on the client is actually a little bit slower. The fragment identifier is not sent to the server meaning the javascript has to be loaded in the browser before anything at all is rendered. Does this lead to several seconds of delay? No. But it is noticeable. At least with push state you have the option of rendering the initial content on the server and all subsequent requests on the client without increasing complexity too much, assuming you have a good templating solution in place.
But yes I agree. Modern Web Apps are Here :)
Running your code through JSLint (or something similar) would have been helpful here. Performing this check before committing code is considered a best practice and it's really easy to setup a pre-commit hook in most version control systems. JSLint has a Node.js mode. It would have said something like "variable used before being defined". http://www.jslint.com/
[edit] just took a closer look at the network activity. this really is the worst way to implement this feature. polling several times a second, sending back a bloated response, and updating much more of the DOM than necessary. this is just terribly hacky. probably done very quickly at the last minute though.
1 1638 Steve Jobs Resigns as CEO of Apple [2011-08-24]
2 1324 Boot a linux kernel right inside your browser. [2011-05-17]
3 1262 Introducing Word Lens [2010-12-17]
4 1232 Today you, tomorrow me [2010-12-14]
5 1196 Google Buys Motorola For $12.5 Billion [2011-08-15]
6 1129 A new approach to China [2010-01-12]
7 1100 Ooops. [2011-06-16]
8 1083 So A Blogger Walks Into A Bar… [2010-09-21]
9 1004 Airbnb Nightmare: No End In Sight [2011-07-29]
10 994 Twitter Bootstrap [2011-08-19]
11 940 Thoughts on Flash [2010-04-29]
12 929 Violated: A traveler’s lost faith, a difficult lesson learned [2011-07-27]
13 906 Chosen: A javascript plug-in that makes long select boxes user-friendly. [2011-07-22]
14 859 I was once a Facebook fool [2011-09-23]
15 856 Osama bin Laden Is Dead [2011-05-02]
16 850 I don't learn anything on HN anymore, bring back the upvote count [2011-04-28]
17 832 How I Hacked Hacker News (with arc security advisory) [2009-06-03]
18 827 Bored People Quit [2011-07-12]
19 822 33GB of public domain JSTOR articles, and a manifesto [2011-07-21]
20 808 A lesson on the importance of encouraging your children with their projects [2011-07-13]
Of course, I have only seen the pitch at f8 but I haven't used the product yet so right now I think exactly what Facebook wants me to think :)
One positive with reducing friction is that it might be easier to find common ground with someone. But overall im not sure I like it- social grooming is a good thing
eval'ing a response from a third party essentially runs their code in your context. JSON.parse does not.
You guys can probably do a pretty effective version right now but I imagine data about what people are searching for allows you to create a better autocomplete feature. And that data only comes with time.