3 ms·
AngularJS owes it success to an easy onboard that allows a user to easily create a gimmicky two-way binding demo. And then the pain begins. It matters little w
by kuni-toko-tachi 12y ago
AngularJS owes it success to an easy onboard that allows a user to easily create a gimmicky two-way binding demo. And then the pain begins.
It matters little whether some find it productive, what matters is that the engineering principles it is based upon are fundamentally unsound.
Control and conditionals in attributes are absurd. Especially when they require learning an expression language unique to that framework. Especially when they create side effects. Why should something as simple as a loop or if create a new controller and scope? This is absurd. The expression language is not statically analyzable to boot.
There is no reason for a framework to do anything beyond handling the last mile tranform between view model and DOM. Everything else can be done through JavaScript and modules.
JavaScript is a wonderfully expressive language, reinventing that through some hacked up expression language makes no sense and buys no advantage.
Bindings can be handled through a multitude of great npm modules.
Watch the video of the Google Analytics team explaining the cortitions needed to make AngularJS performant. Watch the videos where the AngularJS 2 team discards nearly everything from 1.3 (and then adds their own comical nonsense).
Declarative DOM manipulation through a virtual DOM is the future - every more than web components will be. Why? Because instead of being another "web framework", is it sound computer science.
- Cthulhu_ 12y ago> It matters little whether some find it productive, what matters is that the engineering principles it is based upon are fundamentally unsound. I disagree. What matters is whether you can produce a working application - and iterate on that, but after actually releasing. Angular is modular enough to allow for gradual optimization (like integrating React et al), instead of doing premature optimization. Using vanilla JS like you recommend will lead to a lot of reinventing the wheel, and for new developers to have no clue what's going on (they have to learn the framework you thought up). At least you can make predictions about applications when it says 'AngularJS' on the job advert.
- kuni-toko-tachi 12y agoTrue, but Angular reinvents the wheel unnecessarily and at a cost of performance and being difficult to reason about. JavaScript code can be easily written for reuse and composition. When a framework attempts to co-opt that there should be a very good reason. For Angular no such reason exists.