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

Can you not use AJAX through jQuery to gain this instant feedback? Do I really need to load an additional library to send and receive data to the server and update the UI, when I can already do that through jQuery?

This is an aspect of the HTML vs JS rendered page debate I’m still trying to wrap my head around. I understand really large and complex applications need libraries like Angular, Ember, React, and the like to render their pages with JS.

But what is so backwards and old-school about rendering HTML server side and then manipulating the HTML client side with a thin layer of JS and AJAX?

It feels as if the debate is between plain vanilla HTML pages and highly complex JS rendering, without any middle ground and integrating the benefits of both.

EDIT: Thank you for the responses. I’m genuinely trying to understand the pro and cons – of not just each framework – but of the methodologies in general, and your answers help.




Sure. And if you display a count of the number of items in the list, you can update that with jQuery too. Are there other dependencies? Maybe if the list gets too small there's supposed to be a warning message or something shown? I can check the list size each time with jQuery and display/hide the message if necessary.

Eventually as these side effects pile up, jQuery by itself becomes a mess. You have a ton of checks and complex behaviors after each user event.

Or I can provide some structure on the front end so that I can model my data in a reasonable way and have the DOM respond based on changes to that model. Obviously for stuff thats mostly static, server-side rendering is better. But when you're displaying stuff that includes complex relationships and behaviors, modeling it on the client side becomes an important part of maintainability. This doesn't have to be complicated. Backbone is certainly not complicated. But it is the best option if you want to have complex UI behavior tied to an underlying model and need responsive UI feedback.


Your code is always one new feature request away from needing "just a little more" from your front end. Before you know it, your nice and simple JS has to keep a lot more state than you anticipated. jQuery helps, but I eventually realized that it just helps write apps which do aspect-oriented programming on the DOM — and that is completely unsustainable for any but the most trivial app.

Angular has been a breath of fresh air in comparison. It significantly reduces complexity. It's also easy to add to an existing project, even one with server-side templates. At this point, however, I consider the use of jQuery and server templates an antipattern at worst, and a necessary evil for some types of performance optimizations at best.


I agree except for "large complex applications need libraries like Angular" That is nonsense. There were plenty of large complex web apps before Angular and they worked fine. This sudden belief that web apps need a front-end framework is insane.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: