3 ms·
I agree with the premise that front-end and back-end should not be divided, but certainly not with the apparent implication that it should all be moved to the c
by bob1029 6y ago
I agree with the premise that front-end and back-end should not be divided, but certainly not with the apparent implication that it should all be moved to the client, or further into the domain of javascript.
The answer for me has become a very fervent belief that we should be doing all of the rendering server-side. For most business applications, you can deliver a very high quality experience to all platforms with a single, well-built PWA.
Pushing ever more demand onto the client devices and cloud services is producing brittle, unethical applications. If I am running a business, I want to impose as little on my customers as I can. I am tired of apps and websites that are so bloated that my CPU fans have to spin up in order to compile 20 megabytes of someone else's shitty codepile, just so that we can determine what initial UI I should be experiencing. And then, once it finally does load, it runs like total garbage because every scroll event is blocking on some monstrous javascript shadow dom state machine contraption.
If you fully embrace the server-side model and start to use something like Blazor, you can find productivity gains that are unimaginable in a typical api-in-the-middle UI approach. Being able to directly inject your business services into your UI and use the same models as everything else is extremely powerful. Writing scoped state services for each domain of UI, and then being able to compose them with each other allows you to build a well-organized hierarchy of state management that tracks a specific user's interactions across the entire application. Hooking up a user's state management instance into CLR events works just as well as you'd hope it would. Building extremely complex business UIs is almost too easy once you figure out the pattern. Also, because everything happens over websocket it "just works" and you don't even have to think about wire-level contracts/protocols/etc. More brain energy can be spent on cool features that build upon these powerful abstractions.
Scalability is always a concern when you are server-bound on rendering client views, but servers are extremely fast now and I'd argue you should at least make it work for 10 clients before you worry about 10,000,000. Iterate on the points that actually fall over from real world testing. This will probably be much more expedient than poking around in the jungle on hyper-scale architectures from day 1.