Server side logic is usually radically different. And given that you usually share information between the server and the client in a language agnostic manner (e.g. JSON) and that the client (browser) cannot be trusted with other than view logic, I see few cases where implementation specific code sharing contributes greatly.
The server and the client has such different concerns that code sharing probably wouldn't contribute that much.
Except the client can act as a server once you start thinking about localStorage caching. Form/input validation is another thing which is really useful to have on both the client and server and benefits greatly from code sharing.
Basically: Client side validation is about user experience, Server side is about security. I'm hard pressed to believe you can get both with the same code.
I also don't see how localStorage is relevant to code sharing between client and server.
Rendering templated HTML on the server for serving the first page from cache and then using the same code to render subsequent pages on the client is one use I'd like to experiment with.
Comments
Server side logic is usually radically different. And given that you usually share information between the server and the client in a language agnostic manner (e.g. JSON) and that the client (browser) cannot be trusted with other than view logic, I see few cases where implementation specific code sharing contributes greatly.
The server and the client has such different concerns that code sharing probably wouldn't contribute that much.
Except the client can act as a server once you start thinking about localStorage caching. Form/input validation is another thing which is really useful to have on both the client and server and benefits greatly from code sharing.
Except in most cases validation cannot be complete on the client side, anything related to server side logic has to be additionally checked.
Validation is also two different concerns if you compare serverside vs clientside.
http://stackoverflow.com/questions/162159/javascript-client-...
Basically: Client side validation is about user experience, Server side is about security. I'm hard pressed to believe you can get both with the same code.
I also don't see how localStorage is relevant to code sharing between client and server.
Rendering templated HTML on the server for serving the first page from cache and then using the same code to render subsequent pages on the client is one use I'd like to experiment with.