Live data from Hacker News

AngularJS versus Ember

eviltrout.com

101–110 of 163 posts

Re: AngularJS versus Ember

#101
post #65

Can you explain what functionality Angular is missing that makes it a less complete framework than Ember? This premise keeps getting repeated here in the form of Angular being "simpler" -- if it's more simple, but offers the same functionality, I'd take that any day.

Nested views aren't in Angular. Also Angular doesn't really have models. It has data and dirty checking, but nothing a Rails dev would recognize as a model.

Re: AngularJS versus Ember

#102
post #86

The fact that Google is backing AngularJS is a nice bit of reassurance. But are any of their current apps using AngularJS in any way? I realize most of their major apps, such as GMail and documents, pre-date Angular...but they must use it, or parts of it for something prominent, right?

Doubleclick for Advertisers is AngularJS now and that's a pretty big project in terms of surface area.

DFA drove a lot of early refinements in how AngularJS works. Since then, it's largely community driven.

Re: AngularJS versus Ember

#103

I haven't used either of these frameworks but I have used Batman.js[1] which has a very similar feel as Ember.js albeit it's written using CoffeeScript. The two issues that this author are singling out aren't exactly addressed fairly so I sort of feel inclined to defend Angular here. Author states that one downside of AngularJS is that it doesn't conform to the Uniform Access Principle. JavaScript the language itself…

> why are #get and #set acceptable ways of accessing object properties but #area isn't?

Because Ember only has to recalculate the area after set is called on length or width. If area is just a function, it gets recalculated every time it's called/get'ed.

Re: AngularJS versus Ember

#104
post #95

Earlier quoted context omitted.

An offtopic clojure question. Today I was seeing this -- https://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm How can I begin to implement it in clojure ? Specifically, how do I _ingeneral_ deal with assignments and while loops. In common-lisp, for example I would use the `loop` macro and defvar-sefq combo, (beginning lisper). In ruby, = and while itself.

Clojure has most of the semantics you're used to in other languages. http://clojuredocs.org/clojure_core/clojure.core/let (let [username "prollyignored" karma 7] (println username "has" karma "karma points.")) ; prollyignored has 7 karma points. http://clojuredocs.org/clojure_core/1.2.0/clojure.core/loop (loop [n 0] (when ( 0123456789 http://clojuredocs.org/clojure_core/clojure.core/for (for [x [0 1 2 3 4 5] :let [y…

Aha !

Now in,

    while m+i is less than the length of S, do:
        if W[i] = S[m + i],
            if i equals the (length of W)-1,
                return m
            let i ← i + 1
            ....
How would I implement the `return m` part ?

Re: AngularJS versus Ember

#105

Does this boil down to: 1) The DOM is the model. JS reads elements and data attributes and builds a model from them. Then updates the model when the DOM changes. (Angular) 2) The model is loaded from JSON. Then the App builds the DOM based on the model. (Ember) So is the question: Does it start with the DOM, or start with javascript objects? Am I understanding this debate correctly?

I don't think that's the major distinction. Both store models in javascript. Some of the big things being debated are the use of getters/setters and the data lifecycle that happens when you change routes.

Re: AngularJS versus Ember

#106
post #99

Earlier quoted context omitted.

I've worked with both frameworks. You're too quick to judge Angular. Secondly, I suggest you watch Angular 1.2 & beyond: http://www.youtube.com/watch?v=W13qDdJDHp8&feature=c4-overvi... For instance, scope will be optional in the future, not only that but the roadmap for Angular Next is very impressive (see around the 44:40 mark). --- Angular is accelerating; it has more stars/watchers/staff than Ember. Embers' core d…

Angular wasn't invented at Google (it was invented by Angular company, which got acqui-hired by Google) and some Google staffers have mentioned Angular breaks a few documented Google rules for creating Javascript MVC frameworks. I suspect Angular's popularity has more to do with a logo than features. - The unnecessary new module system is a massive waste of time and obviously doesn't play well with others - It's the…

According to angular's FAQ:

> Q: Why is this project called "AngularJS"? Why is the namespace called "ng"?

> A: Because HTML has Angular brackets and "ng" sounds like "Angular".

http://docs.angularjs.org/misc/faq

sigh

Re: AngularJS versus Ember

#107
post #28

Earlier quoted context omitted.

My question is then: why are people purposely choosing not to use the advantages of client side MVC code? You can't trust the client. Therefore a good part of the logic MUST be built on the server side. When you've had to build that logic once, building it again on the client side is a maintainability problem of exactly the same kind that you decry with Angular.js. Except worse, because frequently the client and serv…

I'm mostly talking about sharing data in this post. If you have a user object from the server, why would you need to retrieve it again as you navigate around? It's already been given to you from the server. Secondly, client and server interfaces are not as symmetric as you indicate. Discourse has much more validation logic on the server than the client. We generally "assume success", because the vast majority of requ…

In Angular if you need to share global state between controllers you can just create a service that will fetch the object once and then cache it. I would like it if service/provider/factory were a more unified concept as they can be confusing when starting out. However, once you understand how to use them they are straight forward to use and provide a nice way to share code between controllers.

Re: AngularJS versus Ember

#108
post #41

Just wanted to point out it's also possible to build a highly responsive single page web app with 10,000+ lines of javascript without either Angular or Ember, or any other framework. For example: http://plugg.io

I appreciate the reminder. Pluggio seems pretty clean from the video tutorial!

It seems like you must've had to implement a fairly big subset of something like Angular in the process, no?

Re: AngularJS versus Ember

#109
post #95

Earlier quoted context omitted.

Clojure has most of the semantics you're used to in other languages. http://clojuredocs.org/clojure_core/clojure.core/let (let [username "prollyignored" karma 7] (println username "has" karma "karma points.")) ; prollyignored has 7 karma points. http://clojuredocs.org/clojure_core/1.2.0/clojure.core/loop (loop [n 0] (when ( 0123456789 http://clojuredocs.org/clojure_core/clojure.core/for (for [x [0 1 2 3 4 5] :let [y…

Aha ! Now in, while m+i is less than the length of S, do: if W[i] = S[m + i], if i equals the (length of W)-1, return m let i ← i + 1 .... How would I implement the `return m` part ?

There is no explicit return value because the functions aren't functions: they are values, thus the result of the algorithm is bound to the value that is bound to the function.

When you write:

(defn square [x]

     (* x x))
You are really writing:

(def square

    (fn [x]

        (* x x)))
and x * x is bound to the value of square. There would be no logical reason to have an explicit return value here.
Post reply on HN