News for hackers. Stuff that matters.
Re:Why ClojureScript Matters by Kiro on Monday June 29, 2015 @01:28PM (#9799517)
> but the majority runs on both

What does this mean exactly? What kind of code needs to run on both?

Re:Why ClojureScript Matters by netcraft on Monday June 29, 2015 @01:41PM (#9799613)
I 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.
Re:Why ClojureScript Matters by girvo on Monday June 29, 2015 @11:23PM (#9802737)
Turning 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).
Re:Why ClojureScript Matters by danneu on Monday June 29, 2015 @03:20PM (#9800283)
Another common example is something like a Markdown/BBCode parser.
Re:Why ClojureScript Matters by alanning on Monday June 29, 2015 @11:21PM (#9802725)
The 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/

Re:Why ClojureScript Matters by aidenn0 on Monday June 29, 2015 @05:50PM (#9801395)
Aside 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.

Re:Why ClojureScript Matters by vectorpush on Monday June 29, 2015 @09:43PM (#9802355)
template 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