Hacker News new | past | comments | ask | show | jobs | submit login

So AFAIK they send html back to the client right? that's my understanding of turbolinks

The problem with this is that it makes client and server tightly coupled.One cannot update the client app without touching the server code.

I understand that's a tradeoff but I think a restful architecture serving only json/xml data is better. And you dont have to duplicate logic that much.If any validation needs to happen clientside,create some validation resource for each model and do it entirely serverside for instance. Even SPAs dont need fat clientside models or a complex service layer on the client.




I don't know that what you've identified there is actually a problem in practice – I'd wager that in a system like Shopify's admin, the client and server are inherently coupled regardless of what architecture you choose. Trying to abstract to a client-side app and JSON API in these situations often results in more complexity for few benefits.


This. We ended up creating models for the exact same stuff in both Ruby and JS. Lots of code duplication, and losing client-side performance due to deserializing JSON all the time.


If you have multiple front ends on top of a shared backend, like a desktop and mobile UI, as well as a bunch of third party integrations, then it makes a lot of sense to build the API first. The thing is that it requires three different use cases before you can make an API generic enough to cover the majority of the needs, and that makes it difficult to build the API first and UI later. I believe in the approach, but it's not the right way to go for everybody.


I guess the key bit of the article is:

"These frameworks work well for highly interactive apps with complex user interface requirements. We only needed a small piece of what a full framework would offer."

As you say its a tradeoff...


But one of the nice things with Angular is that for small things you can get away with almost no code at all, small controllers that isn't really depending on each other for example. It is when you start on a larger system you have to think about splitting your app into services, controllers and templates/views and sending information between all those things.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: