r/webdev • • Oct 18 '18

Angular 7.0.0 released

/r/Angular2/comments/9pbn4f/angular_700_released/
223 Upvotes

148 comments sorted by

View all comments

1

u/TheBigLewinski Oct 19 '18

Have Angular engineers invaded this thread? There's a lot of condescension and downvoting being thrown around for anyone who dares question the update cycle.

The concerns of rapid major updates are legitimate. Angular is a framework, not an application. With a complex app, you can't just reboot your code and have it work. People invest lots of time and money building and testing a project, and refactoring because of a major release costs both time and money.

Stability is a major factor when it comes to adoption (for the above reason), and that has cascading effects. Large companies -job providers- tend not to pick frameworks which require significant overhauls just to keep it functioning and secure. And the larger the company, the more important that stability becomes.

To be fair, this isn't just a problem with Angular, it's prevalent in many front-end tools. While every developer understands -and even promotes- the concept of constantly improving tools, there's a threshold, a balance, when it comes to releases. If you are constantly changing your ideas, perhaps your ideas need to sit in the oven a little longer before they're released.

15

u/E2Ehh Oct 19 '18

Not an Angular engineer here, just a dev who uses Angular for their day job.

I think a lot of people who are fans of other frameworks like to jump in and make a deal out of Angular releases as a way to "1 up" for their framework of choice. I tend to downvote comments that don't contribute to the discussion, e.g. people who don't understand semver and just want to take a jab.

You are absolutely correct that stability is a major factor for a framework, and there needs to be a balance between innovation and stability. The Angular team seems to have set that threshold at 1 year. Major versions are released about every 6 months, and breaking changes have a whole extra major version before coming into effect (e.g. an API will be deprecated in v4, and removed in v5). Source: https://angular.io/guide/releases

That's pretty reasonable to me and my team, and if you use the framework as it's intended and practice good software architecture in general, the upgrades are usually pretty painless.

For example, when Http was deprecated in favour of HttpClient, it was literally 1 place in the code to go update, because we have a layer of abstraction between our components and the API. If we had build the app in such a way that each component was firing off API calls willy-nilly, it would have been a real pain. So sometimes when you see people saying upgrades were very hard, it's because they are working on a codebase that has not been built in a maintainable fashion. I would imagine they suffer from similar issues when upgrading other libraries or performing other routine maintenance.

As to your point of companies not picking frameworks based on churn, I think it entirely depends on the type of software being written. If I worked for an agency, and was churning out hundreds of sites a year for different clients, and needed to keep them all patched / updated but was not actively developing on them once released, I might not pick Angular. However I work on a single product (split into a handful of Angular applications), and we've been going since Angular 2 beta days and are still iterating on it with no end in sight. For this kind of product development, some minor framework changes once every 6 months / year is not a big deal, we're constantly doing this kind of maintenance as all of our dependencies update anyway.

So perhaps some of the condescension / downvotes being thrown around are by different groups of developers who don't entirely understand what the other groups are doing day to day. React vs Angular vs Vue vs WhateverJS is a bit of a silly debate IMO, they are all good at different things and people should pick the best tool for the job at hand and be happy for everyone else working on the web platform as a whole - we're all on the same team here!

4

u/gabynevada Oct 19 '18

Any insights on how to perform the HttpClient abstraction? Do you mean performing an abstraction between the HttpClientModule and the services?

5

u/ggeoff Oct 19 '18 edited Oct 19 '18

It's probably something as simple as

class RestService {

    constructor(private http: HttpClient) {}

    get<T>(path: string) : Observable<T> {
        return this.http.get<T>(path);
    }
    ...

}

class UserService { 
    constructor(private restService: RestService) {} 
    
    getUser(id: number): Observable<User> {
        const path = `path/to/user/${id}`
        return this.restService.get<User>(path);
    } 
}

Sorry for formatting on my phone Now you only inject the http client into the rest service so any changes that may happen to the httpclient in angular is isolated to our rest service. edit. fixed formatting

2

u/E2Ehh Oct 19 '18

Yep, this is essentially what we do ^

0

u/[deleted] Oct 19 '18

I couldn't care less about framework war, but this fast release cycle of Angular seems to bite Angular's adoption a lot.

More and more I see people having to choose a framework and there you have 7 versions of Angular (including JS). It's confusing, demotivating, doesn't promote Angular's adoption a bit. It feels like anything but a stable ecosystem.

Now, I know reality isn't that bad and that if you know Angular 2 you know all of the following releases, but whether you like it or not there are plenty of breaking changes between versions and other libraries that interact with them.

This just doesn't promote the adoption of this excellent framework. The last thing I feel I want to do is to start an Angular 7 project now, by the time you figure it out and so did most of the libraries there's already Angular 8.

If google's team wants to proceed that way, I'm happy for them, but Angular's popularity will keep eroding month after month as it keeps eroding since 2016.

4

u/E2Ehh Oct 19 '18

Is that really all that different to picking react, and coordinating changes to react-router, redux, whatever-forms-lib, and the other satellite of libraries you generally match up with react to make a full framework? This is just how front-end development is in general, you either stagnate (e.g. by sticking to an older framework like AngularJS / Knockout - not necessarily bad if it solves all your problems) or you innovate and adapt to change.

I struggle to see how Angular's well documented, regular, steady release cycle is confusing in comparison. In fact I would suggest it as a good reason for (enterprise) companies to adopt Angular over other frameworks. They have clear expectations of upcoming change and how much time will need to be allocated to maintenance.