News for hackers. Stuff that matters.
Re:To boldly go where Node man has gone before by jsprinkles on Wednesday May 16, 2012 @03:15PM (#3983540)
Well, whatever "medium sized" means, I work on a high-traffic Web application that reuses 0% of code from the client; in almost everything I've worked on, I've found reuse between client and server nearly impossible, enough that they're almost always segregated repositories. There's an argument for models existing on both sides (which is reiterated below), but I have a hard time seeing models as 50-70% of any application.

Just not my experience that this is the case. Though I might be old-fashioned.

Re:To boldly go where Node man has gone before by rodw on Wednesday May 16, 2012 @04:40PM (#3983915)
For what it's worth, here's one counter-example:

I've recently been working with a team that is developing a content management system for which the display side of things (responsible for routing requests to models and views, fetching model content, rendering, etc.) is about 500 lines of non-comment CoffeeScript code.

Nearly 100% of the server-side code is re-used on the client, and perhaps 80% of the (non-library) client-side code is shared with the server.

In this case the exceptions are:

- Things like HTTP-level request handling and reading from local files rather than over HTTP are used on the server-side only.

- Things like DOM-manipulation and interacting with browser events are used on the client-side only.

I wonder if a significant factor may be how much functionality you're actually replicating on both the client and server. In our case, browser-permitting, the entire display engine runs equally well on the client or on the server. If we had a lot of JQuery kind of stuff happening in the client-side JavaScript the ratios might be a little different, but "also-run-the-app-on-the-client" is a good example of a use case that leads to a lot of reuse of the server side code.

Re:To boldly go where Node man has gone before by tomjen3 on Wednesday May 16, 2012 @03:21PM (#3983565)
The amount of traffic has nothing to do with it.

A crud app would properly share relatively little code between the server and the client. A multiplayer game would share much, much more.

Re:To boldly go where Node man has gone before by jsprinkles on Wednesday May 16, 2012 @03:25PM (#3983584)
And which do you think is more prevalent in the world, a CRUD app or a multiplayer game?
Re:To boldly go where Node man has gone before by Raynos on Wednesday May 16, 2012 @03:51PM (#3983701)
"medium" means I don't have personal experience of how the percentage scales to large applications.

as for sharing: data sources, domain models, utilities and templates can be shared. its the io handling (HTTP and dom) that can not be shared.