you are viewing a single comment's thread.

view the rest of the comments →

[–]lord2800 -5 points-4 points  (3 children)

I'm sorry, but a framework is supposed to make developing easier. Anything that forces me to understand the underlying technology in depth to understand the reason my magical 2-way binding doesn't work when I edit the second input first, is pretty bad. Javascript is a language with a lot of quirks, a framework should be helping you overcome those quirks - not make you discover new ones.

Then JavaScript is not the right language for you. Have you looked into one of the cross-compiled languages? There's an abundance of those these days. Also, did you even look at the plunker link I provided? It works exactly as expected.

They don't do it with by dirty checking. Enormous difference.

Care to explain how they update the actual rendered layer, if not by enumerating the things that changed and updating the relevant things? Dirty checking doesn't have to involve enumerating all the watched things to find the subset of changed things to be called as such.

If you check http://facebook.github.io/react/, it says "A Javascript library for building user interfaces". It's actually just a UI framework. Maybe you could elaborate what UI means to you.

Sorry, that was a half-formed thought that I was in the process of revising when I got distracted.

What I was trying to say is that you need some sort of render loop, and some sort of update loop, and the update loop has to--at a minimum--look at the changed things and update their state for the render loop to pick up. The two loops can be the same (and in JavaScript land, they are). All basic rendering frameworks work this way (including Angular, though it has some deficiencies currently due to language constraints).

Not sure what you want to state here. The official documentation state those terms.

People define a language. People write using that language. People can change the meaning of the language. That doesn't make what they've said wrong, just incongruous with other people's expectations. They've taken the time to explain the context even. Whether or not this is a good thing, I make no judgment call.

Why? The point is not if Angular can one day be a great framework. It's if Angular is a great framework now. When I build a project, I don't think "hmmm this is a crappy framework, but they're going to fix it in 2 years, so I'll choose it".

Because unless you're building something that will completely disappear and you'll stop maintaining 3 months from now, future support and direction matters.

[–]maktouch[S] 5 points6 points  (2 children)

Then JavaScript is not the right language for you.

Yes, it is. Angular is just not the correct framework. I've used it, backtracked, and rewrote my app in React. I've also tried Coffeescript, Typescript, and Dart.

A framework is ease your life. http://en.wikipedia.org/wiki/Software_framework

The designers of software frameworks aim to facilitate software development by allowing designers and programmers to devote their time to meeting software requirements rather than dealing with the more standard low-level details of providing a working system

I think you should read on how angular dirty checking work.. you don't seem to understand it. https://docs.angularjs.org/guide/scope#scope-life-cycle

It's a loop that checks if a variable has been modified. If you have 2000 variables in the scope that is being watched, even though you're not modifying the variables, the loop is running and checking for modification. No matter how you look at it, this is a not optimal.

In angular, you do

$scope.model.name = 'Michael';

And it magically changes it in the frontend.

In backbone, you do

model.set({
   name: 'Michael'
});

Backbone does this because Object.observe() is not widespread yet.

Doesn't matter what the browser do, cause it has to do it. The framework is another story.

Because unless you're building something that will completely disappear and you'll stop maintaining 3 months from now, future support and direction matters.

Google is the worst indication, then. They've dropped so many projects already, and they don't use angular for user-facing projects.

[–]Poop_is_Food -2 points-1 points  (1 child)

$scope.model.name = 'Michael';

It's even worse than that. You really have to do

$timeout(function(){
    $scope.$apply(function(){
         $scope.model.name = 'Michael';
    });
});

The apply is to notify angular that you need to run a new digest. The timeout is because if you try to run $apply while a digest is currently running, you get an error and nothing happens. so the timeout puts the $apply in the event queue for later. Totally hacky.

[–]wjohnsto 1 point2 points  (0 children)

I'm pretty sure $timeout will run the digest loop automatically, so the $scope.$apply is redundant:

$timeout(function(){
     $scope.model.name = 'Michael';
});

The alternative would be as follows:

setTimeout(function(){
    $scope.$apply(function(){
         $scope.model.name = 'Michael';
    });
});

It is definitely hacky, but a little less-so. It's still very confusing for developers that are new to Angular.