3 ms·
I like the strategy of ditching HTML for Javascript. But it doesn't replace running code on both client and server. Consider writing something like Gmail, or ev
by lacker 18y ago
I like the strategy of ditching HTML for Javascript. But it doesn't replace running code on both client and server. Consider writing something like Gmail, or even just its chat client. You are going to need lots of code that handles connections, communicating when they are unavailable, taking a connection as an argument to some sort of function, et cetera. Wouldn't it be convenient if all of that communication code was the same for client and server? If you're still using javascript and a separate server-side language, you have to write two sets of code to handle any data structure you want to pass between client and server.
- jonnytran 18y agoIt doesn't replace running all code on both client and server, but for certain use cases it does. For example, you have a blog post with comments and a form that allows you to post new comments. When a person visits the page, the HTML of all current comments is loaded. The code to generate that HTML is on the server. But say that you want the interface to be very responsive, and when someone posts a new comment, you want to be able to display that comment in the list with others w/o waiting for the response from the server. Ideally the same code that generated the HTML for the original list can be used to generate the HTML for this new comment -- but on the client. (Of course, to actually store the new comment, you need server side code, which I'm not saying it will eliminate at all.)