3 ms·
consider the advantages in sharing validation code between the client and server Is there a mature implementation of this yet? One that is not tied to an enti
by moe 14y ago
consider the advantages in sharing validation code between the client and server
Is there a mature implementation of this yet?
One that is not tied to an entire immature framework (meteor) or programming pattern (nowjs)?
Code-reuse was the big promise of node. Yet in reality I've never seen it executed beyond brittle experiments.
Where is the form_for_model() function that emits code for both the client and the server?
- reissbaker 14y agoTemplate compilation being able to happen on either the client or the server is a huge win for anyone writing webapps, and it's trivial to write view code that can be compiled in both Node and browsers even without a framework. In other languages, even if you write completely logicless views in a templating language that can compile in the browser like Mustache, you'll end up duplicating your presenter code if you don't use a language that browsers can understand.
- moe 14y agoand it's trivial to write view code that can be compiled in both Node and browsers even without a framework. Nonsense. It's far from trivial to have the same code get binding and validation right on both sides. That's why it needs to be wrapped in a thin abstraction, which apparently nobody in the node-community has been capable of writing. Instead we see dozens of rails-clones (oh, exciting..), and a handful of very half-baked full-stack universes that are nowhere near production ready.