Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Backbone.js todos vs knockout.js todos
We couldn’t find any files to show.
@kylefritz

This comment has been minimized.

Copy link

@kylefritz kylefritz commented Jul 28, 2011

dude seriously! what have i been doing with me life?

@scottmessinger

This comment has been minimized.

Copy link
Owner Author

@scottmessinger scottmessinger commented Jul 28, 2011

Hahaha!

@ibjhb

This comment has been minimized.

Copy link

@ibjhb ibjhb commented Feb 21, 2012

This is slightly misleading because of the data-binding requirement code in the https://github.com/ashish01/knockoutjs-todos/blob/master/knockout-todos.html file.

For example, all of the events for knockout.js are in the HTML. In backbone, they are listed in the JavaScript.

@scottmessinger

This comment has been minimized.

Copy link
Owner Author

@scottmessinger scottmessinger commented Feb 21, 2012

@fguillen

This comment has been minimized.

Copy link

@fguillen fguillen commented Mar 14, 2012

@ibjhb: indeed!

@asterite

This comment has been minimized.

Copy link

@asterite asterite commented Mar 27, 2012

@ibjhb: it's still less than half the lines you need to write.

@JasonMore

This comment has been minimized.

Copy link

@JasonMore JasonMore commented Apr 2, 2012

@ibjhb: I re-did the gist with the html and javascript, all comments removed. https://gist.github.com/2285747
backbone: 253 lines of code
knockout: 111 lines of code

@zpdDG4gta8XKpMCd

This comment has been minimized.

Copy link

@zpdDG4gta8XKpMCd zpdDG4gta8XKpMCd commented May 3, 2012

I am the biggest fan of knockout, but you have to keep as many line-brakes in knockout example as you do in the backbone one, to be 100% fair.

@JasonMore

This comment has been minimized.

Copy link

@JasonMore JasonMore commented May 3, 2012

In line brakes?

@zpdDG4gta8XKpMCd

This comment has been minimized.

Copy link

@zpdDG4gta8XKpMCd zpdDG4gta8XKpMCd commented May 3, 2012

I mean that the knockout example code seems more dense linebreak-wise (empty lines) in comparison to the backbone.

@JasonMore

This comment has been minimized.

Copy link

@JasonMore JasonMore commented May 3, 2012

Hmm.. Guess I'm not seeing that. I know in the gist I made I think I was pretty fair with line breaks, and removing all the comments: https://gist.github.com/2285747

@zpdDG4gta8XKpMCd

This comment has been minimized.

Copy link

@zpdDG4gta8XKpMCd zpdDG4gta8XKpMCd commented May 3, 2012

all I was saying is that you will get quite different numbers if you 1. - remove all blank lines, 2. count what's left. Now you can see it here: https://gist.github.com/2589644 which is based on your revised example without comments (https://gist.github.com/2285747). See, now it's 189 vs 103. Not even twice as big.

@JasonMore

This comment has been minimized.

Copy link

@JasonMore JasonMore commented May 4, 2012

Ah, perfect! I didn't think about stripping out the whitespace, thinking it was needed for readability of the comparison. Yours is definitely a better comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment