addyosmani / backbone-fundamentals

:book: A creative-commons book on Backbone.js for beginners and advanced users alike

Home Page:http://addyosmani.github.io/backbone-fundamentals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it me or ... Confusing example at Backbone Basics / View / Understanding render():

TorbenTigges opened this issue · comments

In the section Backbone Basics / Views / Understanding render(), some basic HTML is given with the words: "Our example will reference the following HTML markup:", but unfortunately, none of the then following examples seem to work with this HTML.

I was perfectly able to understand the examples in previous sections, thanks to copying the code and playing around with it. But these examples just don't give any feedback.

So, maybe it's just me, maybe I am to impatient to wait for the next 5 examples to be slowly put together to finally give me some feedback when playing around in the code myself, but to me this seems to be missing some sort of instant feedback to understand the mechanics.

(Also: The first example code introduces "template" and in the comment it says "// In this case '...' is a placeholder for a template such as $("#list_template").html()"
Imho it would make sense to use the code's actual template id here, #item-template, or switch the id in the HTML markup to #list_template, as used in the comment.)

Next, why does the 2nd example switch from "var ListView = Backbone.View.extend" to "var ItemView = Backbone.View.extend"? Are we supposed to replace the previous code (like the examples in the previous section of the book) or add this below the previous code?

The third example switches back to "var ListView = ..." but is missing anything about the template and also anything ressembling some sort of feedback (markup, console, ...). At this point I am copying code but I can't change it to understand the mechanics. I am sure it will be getting clear later on, if only I bite through this part with the obvious questionmarks remaining in my head, but some help at this point would be nice to keep the learning as smooth as in the (excellent) first parts of the book.

There seems to be a code example missing around line 562. I'm also finding the author's points hard to follow here.

Ah.. I think the code for this is on line 392. If it is, I'm not sure I understand why it's so far from the explanation.