3 ms·
> but the majority runs on both What does this mean exactly? What kind of code needs to run on both?
by Kiro 11y ago
> but the majority runs on both
What does this mean exactly? What kind of code needs to run on both?
- netcraft 11y agoI tend to agree with you, but there are things that can/should run on both - validation of input for one. But I'd like to hear other things - I hear "use the same code on the server and client" all the time, but I haven't found a lot of use for that personally.
- danneu 11y agoAnother common example is something like a Markdown/BBCode parser.
- girvo 11y agoTurning a reactive web application into a regular "web site" -- ie. allowing you to use the bulk of the application without Javascript enabled. Great for SEO, too, at least until Google gets Javascript execution further along (which it's certainly doing, and getting better every day).
- deleted 11y ago[deleted]
- aidenn0 11y agoAside from things like general libraries (e.g. serializing/deserializing data to/from the client), anything you want to happen client-side that you don't trust the client for, you will need to re-run on server side. A simple one is validation of forms, but also doing rapid UI updates without having to do network round-trips.
- vectorpush 11y agotemplate rendering validation routing modular business logic e.g. - calculate total interest paid over the life of the loan provided the client pays x per month etc etc
- alanning 11y agoThe Meteor framework [1] uses this to good effect to support latency compensation. You can optionally choose to include Meteor methods (ajax-style remote endpoints) on the client. Then when the method is called, the client-side version is run in addition to the real, server-side one being kicked off. If the server-side returns an error, such as due to insufficient permissions, the changes made client-side are rolled back. Combined with Meteor's client-side mongo implementation and reactive UI updates, it gives impressive "perceived performance" benefits. 1. https://www.meteor.com/ https://www.meteor.com/