
Are we leaking too much business logic to the front end? - krowemoh
https://www.linkedin.com/pulse/we-leaking-too-much-business-logic-front-end-thanks-like-cervantez
======
krowemoh
Curious what everyone's thoughts are on having business logic in the front
end, validation in the back is fine but should there be an aversion to making
something complex in javascript? Gut feeling is shouldn't but I don't have the
experience to really figure out why.

~~~
rossdavidh
I think the philosophy I had heard was that the business logic sometimes has
to be on the back end, and you don't want to have to wonder where it is, so
since some of it has to be there put all of it there. I think the issue is
that the webapp model doesn't really have a front-end/back-end split any more,
the backend is in some ways more like the database, with the front end doing
what the back end used to.

Except, not always, the backend still does plenty of stuff that is not just
like being a database. So, inevitably, it is increasing complexity to split
this stuff between the client and server. Which means more developers are
needed for the same amount of functionality, and also the code gets into a
Ball of Mud faster. The question is whether or not this is an acceptable
tradeoff, when the alternative is to have a laggier interface. I suspect it is
not, but perhaps I am just biased. Certainly it is a tradeoff that is being
widely accepted.

~~~
krowemoh
That makes sense about wondering where something is because thats one of the
things I deal with when debugging. But that's also a problem in the backend,
I've run into code that is split into multiple places with different versions
of the same program all being used simultaneously.

Is it usually faster to do some logic like sorting and calculations in the
clients browser than to do it on the server before sending the information? If
so then I could see a reason to move some logic out and I may do it if the
gain is appreciable.

------
rossdavidh
An exception to Betteridge's law of headlines.

