I’ve been working with Angular quite a bit recently and figured now was as good a time as any to jot down my thoughts on it.
It’s honestly not that bad. I’ve heard a lot of complaints about it and it’s the most dreaded web framework on StackOverflow but Angular is really pretty decent.
The first thing that you always hear about Ng is that it’s a full-fledged framework. This means you can’t just drop:
<script></script> in and use it. You have to use their CLI, compiler, and build tools to create your web app and work within their framework.
I suspect this is why most people hate Angular. As I’ve written about before, developers hate phony “best practices” or imposed structures on how they write code. We’ve developed entire languages, frameworks, and a multitude of other tooling to basically allow any developer to choose exactly how they want to code.
Unfortunately, the multiplicity of techs is a horrible bane on companies. You have to hire a “React” dev now, not just a generic web dev. If you do hire a React dev, they need to also know Redux and a slew of dependent libraries that go along with it.
Angular, for all its faults, gets rid of this problem. If you know or use Angular, you know it’s routing system, it’s state management system, and it comes with testing built in. These are all incredibly important things to have in a web application. The odds that you’ll have to add this stuff anyway is near certain, so I don’t really have a problem being forced into the Angular structure/world if it means you get all this stuff “for free.”
Finally, the imposed component structure is a nice benefit when you’re (read: a company) churning developers regularly. You don’t have to hunt through the code to find out that one developer stuffed all the CSS into a single file, while another did solely inline CSS, and a third component scoped it at all the way the React docs recommend.
Otherwise, I enjoyed using Angular. I would say that it was actually a lot simpler to use than (gasp) React. It generates a lot more files than React, but the state management I found to be a lot easier to grep. There’s no virtual-dom oddities, useEffect strangeness, or state management quirkiness. I could simply set a stateful variable and then use that variable (such amazing! much wow!) instead of copying into the state and then waiting for the React state to trigger an update to that variable.
Importantly, Angular also allowed me to pretty much do whatever I wanted with the state. I could share it around components and delegate it however I pleased. It didn’t force me to think in React or whatever nonsense and as a result multi-nested component trees became a lot easier to work with.
I also didn’t have to think about the whole hook vs. class thing. The Angular CLI basically tells you how to structure your component when you use
ng generate which I liked. There’s some version-by-version differences when you try to look up how to do certain things, but by-and-large it was pretty consistent.
I still think Svelte is the best developer experience I’ve had by far, but I was pleasantly surprised by Angular. I think its OOTB feature set makes it a pretty compelling choice for building large scale web apps.
My few sentence summary: Angular is the Java of the frontend. Enterprises love it because it provides rich functionality and structure in a fairly ambiguous development world. Developers hate it because it’s verbose, generates lots of files, and isn’t X technology that they would use.tags: posts - tech