3 ms·
I worked a bit with AngularJS. My, definitely over-exaggerated, feelings are that it was a hideous abomination. It's been long enough that I can only remember
by Jochim 3y ago
I worked a bit with AngularJS. My, definitely over-exaggerated, feelings are that it was a hideous abomination. It's been long enough that I can only remember how awful it was to have to register everything with the right strings. A lot of negative sentiment towards modern Angular is probably a holdover from that.
Modern Angular on the other hand just seem full of pointless boilerplate. From a personal perspective, the way it's typically structured just feels verbose and clunky compared to React.
- vekker 3y agoI hear this critique a lot, but what exactly is that pointless boilerplate? When I write a React application, I have to use a lot of React-flavored boilerplate too... useEffect, useState, useThis and useThat... What makes this so different from the Angular TS annotations and lifecycle hooks?
- Jochim 3y agoThese are pretty subjective but: * Angular classes just feel a lot more verbose/messy than the equivalent functional implementation in React. * Perhaps it's just familiarity but I have a much easier time understanding what a functional React component is doing just by reading it from top to bottom. * I have an irrational hatred for separate html template files. * I'm also not a fan of templating via custom html attributes. * Two way data binding is sometimes convenient but feels messy. Pulling a random hello world comparison that starts from a base template from google: React: 16 lines - 342 chars - 2 files changed. Angular 34 lines - 808 characters - 3 files changed, 4 if following common html template practice. React HelloWorld.js: import React from 'react'; function HelloWorld() { return ( <div> <h1>Hello, World!</h1> </div> ); } export default HelloWorld; index.js: import React from 'react'; import ReactDOM from 'react-dom'; import HelloWorld from './HelloWorld'; ReactDOM.render(<HelloWorld />, document.getElementById('root')); Angular hello-world.component.ts import { Component } from '@angular/core'; @Component({ selector: 'app-hello-world', template: ` <div> <h1>Hello, World!</h1> </div> `, }) export class HelloWorldComponent {} app.module.ts: import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { HelloWorldComponent } from './hello-world.component'; @NgModule({ declarations: [AppComponent, HelloWorldComponent], imports: [BrowserModule], providers: [], bootstrap: [AppComponent], }) export class AppModule {} app.component.ts: import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <app-hello-world></app-hello-world> `, }) export class AppComponent {}
- knallfrosch 3y agoAngularJS is just a pile of magic strings that work or don't. Looking at you: $scope, '@' '=' Angular2+ on the other hand, just install the language service and it will enable type checks for stuff like *ngFor even in the template (HTML) files. It will suggest person .name, and if you do person.namee (typo), it will show up as error immediately. That's not far off from TypeScript.
- cout 3y agoI can definitely relate. I started using Angularjs around version 1.1 and remember being completely flummoxed at the error "Unknown provider: $providerProvider <- $provider". Debugging that left such bad taste in my mouth that I probably will never try Angular. Angularjs did get better after 1.5 (when they added components and one-way binding), but IMO the model is still fundamentally broken. Vue fits my mental model much better and is much better documented; if I were to start a new project today, that's probably what I would reach for.