3 ms·
Sure. We can get 80% of the effect with 20% of the effort. Then the last 20% of the program takes the other 80% of the time :-) As an example, I started doin
by Roboprog 11y ago
Sure. We can get 80% of the effect with 20% of the effort. Then the last 20% of the program takes the other 80% of the time :-)
As an example, I started doing Angular development about a year ago. At first, it's really easy - little more than templating output expressions in double curly braces; binding input fields with ng-model attributes; and adding ng-click callbacks to a few buttons.
Then you start making tag libraries, er, excuse me, "directives". Now you start to find out where the monster lives. The complexity of the definition object you make for a directive mushrooms out from the other work you have been doing. Is the directive just an attribute (for existing HTML tags), or does it need to be a custom element with multiple attributes? Is the template part just a string literal, or a function? Do I need to make a "link" function (what does that name even mean, anyway?), and how did all these magic parameters get passed to it? Does this directive get its own controller function? (why do we need "link" and a controller?) Do I give the directive its own "scope" (data model and event-handler/callback function object) instance, or just reuse the scope from the app? How do I pass data between 2 directives?
I'm not faulting Angular (other than maybe for better docs) - I think every framework has that issue of making 80% (if it's a good framework) of some problem easy, but sweeping a real mess into some corner for other work.
- leeoniya 11y ago"All problems in computer science can be solved by another level of abstraction...except for the problem of too many levels of abstraction." [1] I'm waiting for all these custom syntax and conceptually burdened frameworks to implode :) If you like pure js, but declarative templates, check out domvm [2]. I wrote it to improve on Mithril and domchanger. Feedback welcome! [1] https://en.wikipedia.org/wiki/Indirection https://en.wikipedia.org/wiki/Indirection [2] https://github.com/leeoniya/domvm https://github.com/leeoniya/domvm