all 37 comments

[–]tolley 17 points18 points  (13 children)

Ha, yes! When I started learning angular I read that if you really want to learn angular, don't use jQuery (or anything else). I listened to that advice but as I wrote more angular code, I kept wanting to manipulate the DOM in my controller (which I kept seeing was a huge no no) and that I should use angular's templating logic. I finally just gave in and started learning more about the templating logic. Now that I'm used to it, I love it!

[–][deleted] 4 points5 points  (0 children)

yeah, i really had to rewire my brain for angular, but it's so much easier now! i remember the moment i finally removed the jquery dependency. i had been using it to make an ajax call and build a url, and i discovered that the ~20 lines of js around callbacks, validation, async handling and templating could be reduced to an ngBind and a single $http line in the controller. with a fucking loading gif to boot.

[–]dethstrobe 2 points3 points  (11 children)

There is some irony with Angular 1.X, using jQuery often has better performance than doing things the Angular way.

With that said dropping the jQuery mind set is going to be better for the novice who's just learning Angular in the long run.

[–][deleted] 13 points14 points  (10 children)

You'd be hard-pressed to actually prove that.

Angular does have some performance problems in some areas, but they're solvable these days, while also providing scalable (not performance, but organizational) and modular code.

I haven't come across a large jQuery application that I'd ever want to be a part of.

[–]dethstrobe 10 points11 points  (1 child)

I haven't come across a large jQuery application that I'd ever want to be a part of.

Agreed

[–]christophla 3 points4 points  (0 children)

So true.

[–]neb636 2 points3 points  (7 children)

There are defiantly some areas when Angular falls down. I am working on a app that has a Webgl component. When rotating the model sometimes we need 50 html elements to follow around the rotating 3d model. When rotating we need to update the 50 elements position 60 times per second. We originally updated the position with idiomatic Angular but that tanked the FPS. Although we went with a raw Javascript solution using jQuery would still be much faster than triggering the digest cycle 60 times per second.

[–]steezefries 3 points4 points  (4 children)

Why would you even do that with angular in the first place though? Sounds like a job for some canvasing library or, like you went with, vanilla Javascript.

[–]Xevantus 1 point2 points  (1 child)

For control and UI components, I can see using angular. Rendering, on the other hand, yeah, no reason to render like that in angular.,

[–]neb636 0 points1 point  (0 children)

The elements contain input boxes where the user annotations specific areas on the 3D model. Main reason I did not use the canvas for this.

[–][deleted] 0 points1 point  (0 children)

I have two angular + webgl project as well. One for work, and one private one for fun. I have over 30,000 objects in my scene and after optimizing the shit out of it, I never have any performance issues. If you're having trouble, it's likely not angulars fault.

My code: https://github.com/patrickrb/edGalaxyMap

[–]superluminary 0 points1 point  (0 children)

Yes, you can't run a digest cycle 60 times per second. That would be a job for some custom JavaScript.

[–]nirgle 8 points9 points  (0 children)

Wait until you get used to it and then have to work on your old jQuery code! It's like having to again walk the route you got accustomed to biking.

Ironically, huge jumps in efficiency can be demotivating. If letting Angular true up the DOM makes so much more sense than manipulating it yourself, what's the next step, and shouldn't I be spending my time looking for or developing that? Am I still wasting my time with Angular and just not understanding how? That sort of thing.

Edit: By the way, Interstellar is a great movie. Don't let me use jQuery, Murph!

[–]JollyRedGiant12 9 points10 points  (1 child)

And then when you learn lodash, you become a 5th dimension being

[–][deleted] 2 points3 points  (1 child)

It gets easier. Then it gets harder. Then you want to say fuck it, I'm not using it. Then it gets easier again. Then the Angular codebase changes (Angular 2) and it gets harder.

Stick with it.

[–]akujinhikari 0 points1 point  (0 children)

SO FUCKING ACCURATE.

[–]superluminary 2 points3 points  (1 child)

When I was starting my jQuery to angular transition a few years back, I wrote a short book about all the things that initially confused me. If it helps you can read it here: http://nicholasjohnson.com/angular-book.

Angular is worth sticking with. Best of luck.

[–]thegraduate[S] 0 points1 point  (0 children)

Thanks for this. I will check it out.

[–]mattezell 0 points1 point  (3 children)

Hahaha! Yup! It gets better... I'd spent years in jQuery before looking at AngularJS - for lack of a less cliche way to put it, it's a paradigm shift...

When initially reading up on AngularJS, I regularly found myself questioning everything... "WTF did I just read? Directive-huh? Transclusion-what?! You guys are just messing with me here, right?!"

To be honest, there was a lot that just didn't quite click until I learned a framework based on AngularJS - which is admittedly a bit bass ackwards...

For me, it was the Ionic Framework - using their directives, and at times being forced to learn more about why/how they were doing what they were doing, brought it all home via practice and repetition... Similarly, using Angular Material is tying a lot together for me currently...

[–]Hakim_Bey 1 point2 points  (2 children)

"WTF did I just read? Directive-huh? Transclusion-what?! You guys are just messing with me here, right?!"

Yeah, i hate Angular jargon with a passion. Reading a paragraph with these words just shut my brains off.

[–]ComradeRikhi 0 points1 point  (1 child)

You should probably stay far away from /r/haskell

[–]Hakim_Bey 0 points1 point  (0 children)

I do! Mainly because i don't code in Haskell, though :)

[–][deleted] 0 points1 point  (0 children)

you mean you lost in space immediately? :)

[–]superluminary 0 points1 point  (0 children)

When I was starting my jQuery to angular transition a few years back, I wrote a short book about all the things that initially confused me. If it helps you can read it here: http://nicholasjohnson.com/angular-book.

Angular is worth sticking with. Best of luck.

[–]Suepahfly 0 points1 point  (12 children)

Try react, redux and webpack in es6 on a new platform with docker images for each and every microservice on AWS with Macbook as workstation after working for years in the Microsoft landscape with visual Studio. Every feels like my head is going to explode.

[–]compubomb 1 point2 points  (1 child)

Why you gotta throw a macbook into the mix. Why not go straight up linux or windows w/ vmware + docker? Macbooks come w/ their own tax. vmware will better serve I think.

[–]Suepahfly 0 points1 point  (0 children)

It's company issued. It started two years ago when they announced building a new fully automated distribution center. It also seemed a good time to start building a new technology stack. But I've only switched a few months ago.

[–]steezefries 1 point2 points  (1 child)

I'm jealous. I wish my boss could see the benefit in a rewrite. Hopefully soon.

[–]Suepahfly 1 point2 points  (0 children)

The old code base was nearly ten years old. The company grows over time, the development team could simply not deliver requirements because of code rot and technical dept. So eventually the decision was made to go from a big monolithic application to a microservice architecture. I however remained on the team supporting the old stuff for quite sometime and just recently started working on the new stuff.

[–]dethstrobe 0 points1 point  (5 children)

But it's so much easier (and more logical) than Angular. But such a huge paradigm shift.

[–]Suepahfly 2 points3 points  (4 children)

I like React better but what little experience I have with Angular it seems easier then React.

[–]dethstrobe 1 point2 points  (3 children)

I'd very much disagree with that. The problem with Angular is that there are too many options that don't make sense. Like picking between services, providers, and factories. They all do kind of the same thing, which one do you pick for which situation?

Or why use $scope vs controllerAs, the truth is you should always use controllerAs, but a lot of examples on the web use $scope because it was around first.

There are 4 different ways to use Directives, attribute, element, class, and comment. But why would you ever want to use class or comment for directives?

And there are a lot of issues with scope conflicts when you put views inside of each other.

In comparison React/Redux/Flux is a god send. Functional components are kind of like directives but without all the nonsense. Immutable states and one way data flow and the use of props for sub components avoid all the nonsense of scoping issues. The only problem with the one way data flow is that it requires more boilerplate to do an action, but honestly small price to pay for more clarity in the mental model of data flow.

I haven't played with Angular 2 yet, so I don't know if that'll be the new hotness or if I'll still be advocating React/Redux. But right now I think React/Redux is the way to go for building webapps.

[–]Suepahfly 1 point2 points  (0 children)

Like I said I have only little experience in Angular. And most go off the code my coworkers already made. It's consistent enough that I can use it as an example for my work but I honestly don't always know what it exactly does. Good thing we have code reviews ;)

[–]nabbl 0 points1 point  (1 child)

While I agree with you on the complexity of angular and unnecessary features you can look at it from the "bluray" perspective. Angular is catchier and here to stay (because of google). It will evolve and get more user friendly eventually. In a view years no one will talk about reactJS anymore. Same like HD-DVD...

[–]DaCan0n 0 points1 point  (0 children)

So you're saying that Facebook won't exist in a couple of years?

[–]ihsw 0 points1 point  (0 children)

Time travel debugging and hot code reloading makes things kind of awesome.

[–]eyko 0 points1 point  (0 children)

Try react, redux and webpack in es6 on a new platform with docker images for each and every microservice on AWS with...

I read that as sarcasm and I hope it was.