News for hackers. Stuff that matters.
Re:Angular 13 by commandlinefan on Thursday November 04, 2021 @09:35AM (#29106969)
I feel the same way. I just get stuck on trying to understand what actual problem Angular is trying to solve. Like, ok, it's a framework but... a framework for what? Webapps? Javascript is a "framework" for webapps, too.

When I first saw jQuery, I could understand the appeal, but Angular just seems like a lot of extra code for the sake of having extra code. (Like Spring...)

Re:Angular 13 by goto11 on Thursday November 04, 2021 @11:36AM (#29108495)
Angular is a framework for single-page applications, based on components with templates. If a property of a component changes, the rendering is automatically updated by the framework. This is supposed to free you from direct DOM manipulation and let you focus on the business logic.

Angular is somewhat similar to React and other SPA-frameworks, but Angular takes more of a kitchen-sink approach and provide its own dependency injection framework, URL routing, HTTP client abstractions and so on.

In comparison jQuery is just a library, it doesn't really care how you structure your application. jQuery makes it a lot easier to manipulate the DOM, but something like Angular is supposed to free you from having to manually touch the DOM in the first place.

And JavaScript is a programming language, but you probably already know that.

Re:Angular 13 by commandlinefan on Thursday November 04, 2021 @01:20PM (#29109937)
> JavaScript is a programming language

Ok, fair enough - JavaScript + DOM is a "framework" for creating webapps.

Re:Angular 13 by goto11 on Friday November 05, 2021 @05:52AM (#29117202)
Yeah you can say that - the browser environment with DOM and other Wep API's is a framework for client-side apps. Single-page application frameworks like Angular, React etc. are frameworks on top of this, which provide higer-level abstractions and tools. Whether you need these higher level abstractions depend on your use case.

If you have lots of in-page DOM mutation in response to user interaction or data from the server, a SPA framework might simplify things. For a site like HN with very little in-page DOM mutation it probably isn't worth the complexity.

Re:Angular 13 by checker on Thursday November 04, 2021 @11:07AM (#29108120)
So you could certainly write your own component framework, state propagator, router, module framework, build engine, and more. But you'll probably find that, at the end of it all, you have a SPA framework you can share with us. If you're just doing simple web pages maybe you don't need all that, but some types of applications do.