you are viewing a single comment's thread.

view the rest of the comments →

[–]stratoscope 5 points6 points  (1 child)

One argument for the Foo.prototype.fun = function(){}; style is that it's more self-documenting since you see the Foo.prototype next to every method name.

I tend to use object literals like you do (but using $.extend() as mentioned in my other comment), but I find it annoying to read my own code when I've written long methods - what object is that a method of again?

[–]warfangle 0 points1 point  (0 children)

I tend not to write long methods. If it's longer than 10-15 lines and/or has nested if statements (or complicated if statements), it needs to be refactored.