3 ms·
Scope.$digest is 100SLOC long, about a half of which are variable declarations, closing brackets and comments. I think, anyone capable of reading and comprehend
by drdaeman 13y ago
Scope.$digest is 100SLOC long, about a half of which are variable declarations, closing brackets and comments. I think, anyone capable of reading and comprehending normal non-obfuscated JS code should be able to understand what's going on within an hour at worst.
This is certainly not a trivial part of the code (tree traversal is a bit obscure, they even have comment that it is; it probably could be much nicer if JS would really had graph handling in the standard library), but certainly not "hard as hell", it's more likely "if you need to understand this (as if something goes wrong or works in an unexpected manner), you have to spend some time to get how internals actually work".
I have seen the code that is very hard (if not nearly impossible) to understand without some special knowledge. Angular, in my opinion, is not even remotely close.
- ulisesrmzroche 13y agoThe thing is that if you've ever built anything significant in JS, you're going to have a couple war stories and 'easy' is the last thing that you'd call the stuff.
- drdaeman 13y agoObviously, I had such stories where I had spent many hours doing what I wanted in a manner I wanted it to do. For example, I had problems with content transclusion and had to dig relatively deep into the source code to figure why I'm not getting what I believe I should. Software without bugs is nearly non-existent, and Angular is still not very mature in some aspects. But in overall, Angular is very easy - after you spend a day or two toying around, groking the terminology and core concepts. Way easier (in my opinion) than, say, Sproutcore (which I found too complicated to my tastes to invest time learning).