Hacker News new | ask | show | jobs
by Zanfa 1137 days ago
> In my experience people that hate Angular don't understand why they hate Angular.

One of my major annoyances is the templating language. Completely unnecessary and over complicated, compared to JSX. Just another weird syntax to learn with its own arbitrary limitations and quirks.

I think it’s a good indicator of the overengineering surrounding Angular overall.

3 comments

I see it as the opposite. JSX is a convoluted mess, and does not make for easy reading due to being mixed in with everything else, while Angular promotes clean separation and promotes a template language like many others. It's usually React codebases that I've seen overengineered due to lack of features, while Angular codebases are very same-y - that's a good thing from maintenance perspective.
Obviously there's some matter of taste, but JSX is simpler in my mind, because it's just JS with a tiny bit of syntactic sugar to have nicer function calls for components. That's it. Anything you can write in JS, you can write in JSX and it works. You can debug and use all the tools you'd use for regular JS.

With Angular templates, there's an entire new language, with its own weird syntax ngIf/else, ngSwitchDefault, let-*, pipes and other components that get pulled in based on whether you forgot to set up correctly or not in modules far-far away somewhere in the codebase, brackets of different sorts having different functions and just a lot more stuff to remember. And if it doesn't work, you're gonna get a silent error most of the time with no easy way to set a breakpoint to investigate.

I also don't believe there's any real separation between the HTML templates and the Component class, just because they're written in separate files. They're just as tightly coupled as any regular React component, just harder to follow. I don't think I've ever seen an Angular component, where you could swap out the template, without making simultaneous changes to the Component to accommodate it, which should be possible if they were truly separate.

I personally find JSX terrible with its very-very strange arbitrary quirks.
And you say the same of Vue and Svelte, I assume?
I haven't had the chance to work with either much, but at the end of the day, a new new syntax just for doing fancy if/else/for seems unnecessary. I believe Angular's hand was forced since JS at the time didn't have as ergonomic syntax as it does now, with fat arrow functions, .map and other niceties.