Skip to content

Comment on WebGL + Node.js + WebSockets = A Web Technology Perfect Stormparent

Comments

> Sharing code between server and client (browser) is much easier, and there is no alternative to javascript in the browser.

That's a fallacy, the environments have nothing in common, the coding styles and interactions don't either, the only things you're going to be able to meaningfully share are trivial helper libraries à la underscore..

> and writing server code in the same language simplifies things.

Why? How? Where? I see that assertion often, but I have yet to see it backed by anything but "because I said so".

Actually the environments have a whole lot in common. Templating, validation and data retrieval/storage for example can be done both client & server-side, depending on the situation.

A fallacy? Sharing code between client and server is easier when the two are in the same language than when the two are in a different language. How is that flawed reasoning?

One example: you can run the same input validation in the client as you do in the server if you can easily share code between the two.

But there is way more. Here's an example of an application that shares all of its data models between client and server: http://tilemill.com/docs/models.html

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.