Questions, Answers, Tutorials and Information out of date


#1

I have spent the last three weeks studying the Ember.js guides and API information on the website. The walk-thru was fairly helpful but it felt like a rabbit hole - I was able to complete everything, I felt like I really started grasping concepts, but then at the end when I went to build my own Ember app I realized I was only able to complete it because of the guidance given.

So I spent time playing around and googling various questions. StackOverflow answers seemed great until I realized most of the questions are out of date and most of the solutions are either deprecated or the jsBin’s they show are broken from changes.

So I spent more time studying the guides and API but the learning curve seems high and I wanted to share my thoughts on why and see if anyone has any advice to offer -

1. The guides use basic terminology but have over-simplified it without giving explanation.

The guides use terms like ‘Route’ and ‘Resource’ all over the place without giving a better understanding of which to use and when. They go into a lot of detail about the controllers, views, and other things that are provided by convention but after three weeks I am still struggling with how to nest templates inside of other templates because resources and routes are improperly set. When I goto SO.com and look at answers most are from December 2012 - March 2013 and don’t work or display deprecated features.

Templates seem fairly easy to grok on their own but when nesting them the guides jump around between templates, views, and partials without giving a clear explanation of why you would use one over the other and distinctly showing examples of their usage in full. The guides show what setting up templates and views looks like but not their actual usage.

What would I suggest to fix it? As a heavy user of Knockout.js I always point new devs to their tutorial walk-thrus @ http://learn.knockoutjs.com/ and tell them go through each one three times before you ask me a question. Giving some sort of live tutorial like jQuery and Knockout that doesn’t tell you what to do but gives you suggestions would be AWESOME, showing not just how to build a single Route/View/Controller but go on to more advanced topics like nested routes. Just cover the basics one would need to build out a simple ‘view’. Also, and more importantly, go back through all old but highly voted SO.com questions and answers and update them so people find valid answers

2. Too many answers point back to StackOverflow.com questions/answers that are no longer relevant

To build a community the community members should be a part of enhancing said community. While everyone here embraces the technology the truth is it needs to be adopted more widely to continue to grow and prosper. (that is an opinion of mine obviously) To get more people to adopt it it must be easier than it currently is to grasp. It’s the learners paradox - it is hard to learn / search for things when you don’t know what it is you are trying to learn. As I pick up more concepts I realize how simple it was in hindsight but by then it was already a touch too late.

3. Too many answers to questions all around the net are ‘You just can’t do that in Ember’ or ‘that’s the Ember way’

While both those statements are proper ways to end an answer they aren’t good ways to start them. When giving someone assistance or help it gives no real aid to provide code showing them exactly what to do, it gives little help to point them to the guides to ascertain why their question relates to the specific page you are linking, but it does wonders if the person giving the answer can give some code hints, possibly a working small example, and explain ‘the reason you should do it this way is because…’ and go on to give a brief description of the idiomatic way it is achieved and why void of condescension

4. Ember needs to divorce Ember-Data from the guides

Including an optional persistence library like Ember-Data makes Ember seem heavily reliant upon it and also gives the feeling that learning Ember means learning other libraries. One of the biggest turn-offs to the Angular.js tutorials that I saw and went through almost a year ago was that they all started out like this -

  • Get Angular.js
  • Open your text editor and add a dependency on Angular.js
  • Install node.js and create a small server to serve up JSON, make sure ports are opened and the server is serving up the JSON properly

WHAT?!??! Now in addition to learning Angular I need to take a node tutorial and set my environment up for that as well?!?!

All of this is just my $0.02. Feel free to look me up on GitHub (pwkad) and SO.com (pwkad) or anywhere else, criticize my background or knowledge base, and tell me why I am wrong about the above points.


#2

A couple thoughts here.

1.) Guides

Yes, they can be a bit simplified. But there is a lot of depth in the Ember internals that are difficult to surface in guides. It is a balancing act between satisfying introductory topics and intermediate to advanced topics. I would recommend looking at the API docs for more specific info. No doubt about it there is a learning curve to Ember.

The Ember website itself is open source . See a problem in the guides or a particular place it is ambiguous or unclear, feel free to work on a PR. We are the community. And this is an area where feedback is always encouraged.

2.) The stackoverflow problem.

This is a known issue. My understanding is that Ember has gone through a lot of API churn especially as it introduced some refactorings on the way to 1.0 API stability. Which happened August 2013. Because of this there has been a lot of “legacy” answers on SO that just don’t apply to post 1.0 Ember. Unfortunately, some members of the SO community can be a little pedantic and there are not a lot of great tools for cleanup within SO. There are some efforts to try and address this question by question. But it is going to take some time. Read this blog post for a summary of the issue.

3.) “Can’t do that in Ember”

Not sure what to say about this. Usually if someone resorts to saying this it is likely uninformed opinion. The reality is you can do a lot of things in ember. It just might be extra difficult depending on the specific task. There are certainly conventions that you are encouraged to abide by. But underneath Ember has a lot of very powerful primitives that let you do some amazing stuff. But there is no shortcut to learning those. Thousands and thousands of dev hours have gone into the framework.

4.) Ember Data

This has been a long standing controversy. But IMHO the criticisms levied against ED are often unfair. The core team has always been consistent about giving warnings about the status of Ember Data. It is a powerful framework but in beta. I think it is very near official release though.

You may be right that there needs to be a clear separation in the guides. Because persistence is a difficult problem and kind of an advanced topic. And Ember Data is just one of many ways to tackle that problem. But at some point one will need a system for dealing with persistence. Most apps are not that interesting without this core feature.

As far as node is concerned. You don’t have to learn it but getting familiar with the Node ecosystem will make your life easier in the long run because a lot of tools depend on it. So yes it is something to learn but it just a tool that helps in the automation. That being said it is totally possible to learn and do ember without ever touching node. You just have to do a lot of things manually. Two avenues to explore:

Use JSBin to prototype ideas

Or download the starter kit from the ember js website.

Neither require additional build tools, all you really need is a text editor and a browser. Recommend using chrome because that browser has pretty good dev tools. Also check out the ember inspector a plugin for chrome dev tools

One thing you may find as you explore ember is that a lot of the more advanced code examples are built using build tools and systems. There is something called Ember App Kit that uses ES6 module style syntax. It is going to look a bit different than the vanilla ember you might find in something like a JSBin or the Starter Kit. Just a heads up.

And finally as far as getting help from the community one thing that has worked for me is trying to distill my problem down to a simple case with JSBin. It is easy to share the work and communicate the problem with someone else. I know that other people are really busy so the more work I can do to make it easier to answer my question the better. And JSBin is great for that. Also, more often than not I find that working through a JSBin example forces me to clarify my thoughts and understanding of the problem. It has been a great learning tool for me personally.

Hope that helps. And welcome to the Ember Community. Hit me up if you ever need some pointers.


#3

Thanks for the links. A few quick notes -

  1. The node mention was referring to when I was checking out Angular.js and the tutorials required installing node and serving content. It was a lot at the time, and I wanted to point out my frustration at wanting to learn one thing and being forced into other tech and comparing it to the Ember / Ember-Data issue.

  2. The Ember-Data issue seems to be a common complaint so no need to keep bringing it up I guess : )

The links were helpfully in getting up to date on the topics. It’s interesting that the SO meta put a stop to ember-invalid. One thing I do when I get to an answer that is a year old and no longer up to date is to go ahead and down-vote it. Looking at the referenced Google doc in the link it looks like there are an absolute TON of old questions so that isn’t going to be as easy as it looks. I would gladly provide a better and more up-to-date answer but I am still way too early in learning.

All in all my main intention with this post was to document my thoughts as a beginner so they aren’t lost when I do grok it : )


#4

Totally. It is hard to escape the server/backend part of this. That is the reason for the tools like node. Basically a lot of devs these days like to use node because they are familiar with Javascript and there are a lot of module and packages out there.

Node is a tricky beast for the uninitiated. I come from a rails background so it was a little bit of a culture shock to figure out the node stuff.

If you need to setup some JSON to test your ember app you have a few options.

1.) Use Fixtures. Just embedded static JSON in your app. You can use this in JSBin. But you do need to include Ember Data to get access to DS.Store

Here is a simple JSBin that illustrates the concept

2.) If you use Ember App Kit (requires node and grunt) it comes with an API stub that you can just dump JSON into.

http://iamstef.net/ember-app-kit/

http://iamstef.net/ember-app-kit/guides/mock-and-proxy-requests.html

3.) Use something like Sinon.JS to mock and stub your JSON and basically simulate a backend server to your ember App.

http://sinonjs.org

4.) Build a separate “api server” with the backend technology of your choice (Ruby/Rails. Python/Django, PHP/Symfony, Perl, Java, etc).

I know that Python has a handy little utility called SimpleHTTPServer I use this all the time if I just want to get a webserver on localhost and serve up some static HTML or JSON files.

http://www.pythonforbeginners.com/modules-in-python/how-to-use-simplehttpserver

I believe Tom Dale used this trick in one of the demo videos he gave in his famous “cage match” comparing Ember to Angular