Hacker News new | ask | show | jobs
by bsaul 3387 days ago
I completely agree with the general point, however at the minimum this lets client and server share the same exchanged models ( what the server sends to the client is defined once, as well as the opposite).

There may be technologies like protobuf to define those structures in one place, but i can still imagine there are cases where it could be useful ( business rules and validation, etc).

1 comments

Yeah, the most obvious benefit is being able to share validation logic across front-end and back-end. All validation is necessary on the back-end for security reasons, but it's convenient for users if it also happens on the front-end, because they don't have to send data to the server before finding out it's invalid.