3 ms·
(sorry if this comes off a bit snarky) "Overuse of the eventing system ($watch, $emit, $broadcast) leading to performance problems and memory leaks and not rea
by yummybear 12y ago
(sorry if this comes off a bit snarky)
"Overuse of the eventing system ($watch, $emit, $broadcast) leading to performance problems and memory leaks and not realizing it or being able to debug it"
Blindly overusing most features in frameworks or libraries can cause performance problems. Which memory leaks?
"Writing Controllers and Directives that take dependencies which make them nearly impossible to test."
Doesn't dependencies in general make any code harder to test?
"Views that are heavily dosed with logic - but more on that later"
I certainly don't feel my views are dosed with logic? Which kind of 'logic' are you referring to here? Is there something preventing you from moving your logic outside of the view?
"Their first experience of DI is quite often that in Angular and it's horribly broken. Since the "patch" which fixed the minification issues, it's still really just a square peg in a round hole with woeful support for scope and lifetime and features which most DI gives you for free such as child containers. They end up hating DI and shy away from it on other projects."
This seems like wild speculation here, as well as not being very specific (how is it broken?). I'm sure DI in Angular could have been done in a more elegant way (I have no idea how), but I don't seem to run into any problems.
"Strange bugs that (when called over) have us all scratching our heads until one of use realizes - oh yeah, sorry we forgot to mention that pretty much everything passed around is global, and Directives etc. aren't namespaced, so I see what's happened - you've got a naming collision there"
Not sure what to respond here - you had a bug in your code and discovered it was due to naming collision. Do you run into this daily? I've run into 'strange bugs' or at least hard-to-diagnose bugs in almost every framework or library I've used.
None of these issues seem especially unique to Angular. I'm not saying Angular is a perfect framework, but my own experience have been mostly pleasant, and I don't feel that there is anything in particular in Angular vs. other frameworks or libraries that encourage bad behavior - juniors or seniors.
- eyko 12y ago"Blindly overusing most features in frameworks or libraries can cause performance problems. Which memory leaks?" Binding to event emitted by an object on another object, then deleting the receiver, can cause a memory leak if you don't unbind first.
- yummybear 12y agoTrue, but hardly unique to Angular.
- rubicon33 12y agoiOS has the exact same situation for it's notifications framework (essentially, observer pattern). From what I've seen, consistently across frameworks that support the pattern, that you need to de-register your listener before releasing it from memory. Pretty funny to think, I'm a "junior" developer and even I know that you have great power, but also responsibility, in the observer pattern.
- fixermark 12y agoI can't disagree more with the author's assessment of Angular's dependency injection. DI in Angular was the first time DI made sense to me. And it makes testing really staightforward: test the component you're on top of, mock and fake the rest. Lots of boilerplate, but no actual hassle.