Live data from Hacker News

EmberJS Confuses Me

wekeroad.com

101–110 of 142 posts

Re: EmberJS Confuses Me

#101
post #91

I tried Emberjs and Angularjs recently, as both framework offered two-way binding between view & model, at client side. Angularjs was easy to pickup and I have completed what I wanted to do in about half a day, except one issue, angularjs template rendering is DOM driven. I wanted server-side templates, hence I have to boot phantomjs at server-side. I didn't quite like booting phantomjs for server-side templates. Sin…

In what circumstances would you want server-side templates and how come it's easier with Handlebars?

Re: EmberJS Confuses Me

#102

Don't give up! Ember has a steep learning curve but once you've got a bunch of it memorized development gets much easier.

I learned Angular instead since it was easier to get my feet wet with it and seemed to make sense to me. Am I missing something by not using Ember?

Re: EmberJS Confuses Me

#103

While I actually totally agree with the confusion in the router, I want to explain what I see in Ember's MVC: As far as I attempted to implement it in my app ( https://github.com/thomasboyt/noted-app ), it seemed simple enough. Models were data; all they contained was their properties and operations that controlled their properties. I mainly used controllers as the "state" for parts of my app. In Ember, this doesn't…

Seems reasonable, but the Ember team sees it differently... they put state in the router : >Most of your controllers will be very small. Unlike other frameworks, where the state of your application is spread amongst many controllers, in Ember.js, we encapsulate that state in the router. This allows your controllers to be lightweight and focused on one thing.

I rationalized this as the state-machine kind of state, of the application.

Re: EmberJS Confuses Me

#104

Seems like the big confusion about the controller is that it is closer to a ViewModel (think MVVM) than to a Controller itself. Potatos, Potahtos.

Model, View AND ViewModel? What kind of confusing terminology is that? I use KnockoutJS but I still don't understand why it's not just called MVC.

Re: EmberJS Confuses Me

#105
post #101
post #91

I tried Emberjs and Angularjs recently, as both framework offered two-way binding between view & model, at client side. Angularjs was easy to pickup and I have completed what I wanted to do in about half a day, except one issue, angularjs template rendering is DOM driven. I wanted server-side templates, hence I have to boot phantomjs at server-side. I didn't quite like booting phantomjs for server-side templates. Sin…

In what circumstances would you want server-side templates and how come it's easier with Handlebars?

SEO.

Re: EmberJS Confuses Me

#106
In the past I've been working on enterprise application suites for the desktop. The kind of monstrous applications that run on electronics manufacturing floors. Such a typical application has a shell, modules, inter-module communication, dynamic module loading, plugins, and much much more.

One can think of it as Eclipse with its ecosystem.

To build such a system on the Enterprise with its typical NIH (not invented here) paranoid attitude was VERY hard.

I had to reinvent a lot of wheels.

On the Web, I've used backbone for a long time now, since almost the time it was out. I saw the same problems building complex applications with it (that backbone-marionette amends to a great deal). For a larger project, I evaluated Angular. Had very strong negative feelings about it.

Then I tried Ember. It took me a long time to "get" it. The only thing that kept me motivated is knowing that Yehuda, Tom and Trek and other capable people are contributing on it. I kept fighting through the outdated tutorials, the outdated videos, and even the peepcode video was embarrassingly confusing to me at some point.

But then it hit me. Ember and its infrastructure, the way its MVC is rigged, was very similar to what I was building from scratch on the desktop many years ago. It truly IS the one framework that "gets" desktop, or client-side, applications.

The causer of my confusion was that I didn't completely let go of the "Web-think" for building application. I was stuck at either server-side MVC (MVP), or bare-bones frameworks such as Backbone.

It's been just too long out of the real complex desktop game for me, to realize what that I'm looking at is a proper MVC framework.

So for me, Ember ended up as being great - it still takes me back to the way I was building desktop applications, and I'm sure it will become even better and better. To understand it, you need to cold-boot your thoughts into that classic desktop MVC place; and if you were never in it, I think Ember is an excellent way to get into it as opposed to other frameworks.

Re: EmberJS Confuses Me

#107
I have been into MVC frameworks for 4-5 months now...mostly used BackBoneJS before switching to EmberJS..conceptually I did felt EmberJS very tough in the beginning..i was worried whether i made the right choice in using EmberJS for my product..but now with the latest 1.0rc2, its so easy in development..routing has been improved very much..Binding is the awesome feature i liked and helps me thgh..an added advantage over BackBone...i cant say about angular..but am quiet happy with EmberJS...

Re: EmberJS Confuses Me

#108
i've been using ember for the past three months in a fairly complex project and i'm very happy with it ; a platform that builds business web apps dynamically for devices (20+ pages,250+ fields per app with validations, calculated fields, conditional flows etc , rendering/theming in jqm -> packaged with phonegap) and client web browsers (render/theme in bootstrap),the backend is in java. So, i certainly don't feel the same way for emberjs as the writer.

I had decided to build the frontend in a js mvc framework and the candidates were backbone, emberjs (pre version), angularjs. Read about them and gave backbone a try, however from the documentation only emberjs approach felt better maybe because of a similar in-house development java framework that we work on. So i tried to give emberjs a try at the same time, due to the tight deadlines. I dropped backbone, and spent more time on emberjs because everything simply worked and fitted together nicely. All these binding mechanisms are great and actually work :) . Haven't tried angularjs.

The system now works with emberjs (pre and rc) with a nice layered architecture and separate independent business logic modules.

My advice is to read the documentation carefully and choose what fits better to your needs and coding styles.

Re: EmberJS Confuses Me

#109
post #29

> The downside to this approach is that your HTML is "compromised", if you will, and many developers don't like that. My thought is that it's already compromised using Handlebars so what's the difference here? Personally I have no issue using the ng-* directives. Some people do, and I respect that. I'm a bit off-topic, but you don't need to "compromise" your HTML with AngularJS, you can place "data-" in front of your…

When I hear this argument I believe the concern is not the syntax of the binding with respect to the HTML spec, but rather the declaration of bindings in HTML at all. So the issue is not "ng-click" vs. "data-ng-click", but that "ng-click" in any form is no different than the pre-JS MVC horrors of onclick="mutateGlobalStateAndPerformIO()"; which is precisely the barbaric approach we thought we were vanquishing. I thin…

I dislike data binding with a vengeance. From Windows Forms, to Web Forms, to WPF, to Swing, to QT QML, to AngularJS. I don't think this pattern will ever work for me.

Re: EmberJS Confuses Me

#110

Yes, I too agree EmberJS always a confusing library, Following are my resaons. 1)They say it follows MVC. Its actually MVC but MVP, if you look closely at the implementation. 2)Controller job is not precisely defined. Example: Even the data validations are done at controller level not a model level So i switched to Backbone.js, which is very flexible library with tons of plugins that can be used when needed. Since im…

  Regarding AngularJS, please use it only if you are new javascript and prefer learning Angular Javascript (which is not javascript by the way) :)
I am not sure you "know" javascript. If you are saying that there is an Angular version of javascript then you are terribly mistaken. Angular is probably one of the only mainstream framework that stays true to javascript. All other frameworks ( Backbone, Ember etc.. ) are the ones that actually mould javascript into an OOP language. I would say that Angular uses the prototype chain ( you know javascript is a prototypical language right? ) the best. The whole scope object inherits prototypicaly while in all other frameworks we create an illusion of OOP. Someone correct me if I am wrong here.

Just for clarity, I believe that when you write Angular code you are writing the purest form of javascript. Because thats what you are writing there. Just plain javascript. There is no constructs imposed by the framework at all. This is probably why most people think "Angular's javascript" is not javascript. They have been always fed layers on top of javascript because "javascript is somehow not optimal, not right" and it has to be "changed" and "corrected" . OOP is shoved down the throat. This is probably gone on to the extent that when someone actually writes in pure javascript it starts looking like a foreign language !!

Post reply on HN