6 ms·
I know Angular isn't 'cool' on HN, but damn I'm excited about this! Signals in particular. Well done to the Angular team.
by jmkni 3y ago
I know Angular isn't 'cool' on HN, but damn I'm excited about this! Signals in particular.
Well done to the Angular team.
- pwb25 3y agoI don't get why, Angular is really nice and has so much included and is well documented and no need for reflux and redux libraries that might do or not do what you need
- Illniyar 3y agoI don't know about others but the move from AngularJS(v1) to Angular burned that bridge for me. Developers have long memories. And the fact google keeps burning good will with other shutdowns isn't contributing. Besides that Angular is also a heavy framework (gives a lot, but requires you to do things in a very specific way) where hacker news crowd has usually a preference for unintrusive frameworks and ones that give a lot of freedom and leeway.
- Jochim 3y agoI 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.
- rk06 3y agoLook at this way, angular 16 is now introducing signals, vite support and improving standalone components. Now, let’s compare to Vue, Vue has Standalone components, vite support, signals since v3. And fine grained reactivity since v0. So, one must ask if here things are so good, why stick with angular and wait for everything to stabilise when you can jump ship to Vue now? Similar argument can be made for react, though I admit hat Angular to react transition won’t be as easy. And this is in context of newer advancements only. When you take a step back and look, you will see many cases where certain angular issues are only in angular. While rest of the js frameworks are converging
- Jasp3r 3y agoI wouldn't call reactivity in Vue "fine grained". Every object that gets loaded into component state becomes reactive, and every piece of code that touches it gets dragged into a massive internal dependency tree. Vue has blacklisted reactivity, everything becomes reactive (and observed) by default and you can opt-out, while MobX features whitelisted reactivity and is much more fine-grained
- rk06 3y agoI say fine grained as changes in an object will invalidate only that object, and only it's dependencies will be updated. Contrast with coarse grained reactivity I. E. angular, where it must dirty check all "reactive" objects to identify the changed object. As angular can't tell exactly which properties changed.
- cout 3y agoWhat is vite?
- xupybd 3y agoHow do you find the upgrade path. It's been a long time since I was working with Angular 2. I felt a little fear at the pace of improvements. It seemed that for a long lived application I'd be forever spending time upgrading the framework. Is that what it's like or are the upgrades reasonably easy?
- orbz 3y agoThey're actually surprisingly good at making the update process as painless as possible: https://update.angular.io/?v=15.0-16.0 https://update.angular.io/?v=15.0-16.0
- knallfrosch 3y agoI feel like there's a real major upgrade every 3 years, which is reasonable given the pace of web development itself. The "Ivy" renderer was a big one, but it was introduced in 9 and you had until 12 to transition. Still, these were like 5% of what you had to do from AngularJS to Angular2+. Now 14 to 15 is a bit more work again, but they have introduced an upgrade guide like this: https://update.angular.io/?v=14.0-15.0 https://update.angular.io/?v=14.0-15.0
- throw_m239339 3y agoMy React V1 app still works with the latest React version. That's why I don't like Angular.
- steve_adams_86 3y agoThey’re different things, though. React has a lot less going on. If you want something with a stable API for the tasks React is suited to, it doesn’t make sense to throw Angular at that job.
- azangru 3y ago> React has a lot less going on. I don't think that's quite true anymore. As someone sarcastically remarked on Twitter [0], React has patched native events with synthetic events; has rolled out its own scheduler in order to achieve the suspense effect ("patched the event loop"), and is going to patch the native fetch for reasons that I am not clear about, but that are doubtless also suspense-related. With hooks, it introduced a syntax with a set of implicit conventions that, confusingly, still looks like javascript, but has significant differences from how javascript works ("the rules of hooks"). React provides its own way of lazy-loading modules; its new server-side renderer currently assumes that when React rehydrates, it takes control of the whole DOM tree; and the docs are now strongly recommending people to use full-fledged frameworks (Next, Remix) when starting new projects. React has long outgrown its "it's just a library" stage, sadly. [0] - https://twitter.com/RogersKonnor/status/1618739256775815168 https://twitter.com/RogersKonnor/status/1618739256775815168
- mablopoule 3y agoYeah, the most WTF thing I've seen React do is to mess with console.log by silencing them (WTF #1), which was particularly appalling since React did it only because it run the rendering twice under StrictMode (WTF #2), and only during development so you're not sure what the real behavior will be until you run it on production mode (WTF #3). Messing with the console is such a no-go that I'm appalled it even passed the drawing board, making the "React isn't a framework, it's a library" argument even more bonkers than it already is.