3 ms·
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 fo
by commandlinefan 5y ago
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...)
- checker 5y agoSo 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.
- goto11 5y agoAngular 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.
- commandlinefan 5y ago> JavaScript is a programming language Ok, fair enough - JavaScript + DOM is a "framework" for creating webapps.
- goto11 5y agoYeah 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.