It doesn't seem like they currently do this, but it would be great if Amazon applied file de-duplication (like Dropbox) to at least music files. If I'm trying to upload a song that Amazon already has on its own servers, it should just use that copy instead of uploading a new copy from my computer.
MP3.com once got in a ton of hot water for a version of that. They had an integrated ripping system that if they already had the content it just checked the "hash" of the TOC and granted you access to the music. In this way you could borrow a stack of cds and very quickly have access to all of your friends music.
I'm not sure if having to upload your music before it's de-duplicated makes a legal difference, but I bet it came into play. I have long thought of the possibility of hacking up the dropbox binary to fake hashes of known music I didn't have and get access instantly
Judge Jed S. Rakoff, in the case UMG v. MP3.com, ruled in favor of the record labels against MP3.com and the service on the copyright law provision of "making mechanical copies for commercial use without permission from the copyright owner." Before damage was awarded, MP3.com settled with plaintiff, UMG Recordings, for $53.4 million, in exchange for the latter's permission to use its entire music collection.
That was a really interesting talk--thanks for the link!
Something that initially confused me was that Eich's use of the term "prototypal" (a pattern for implementing class-based inheritance) was different from Douglas Crockford's use of it (an alternative to class-based inheritance - http://javascript.crockford.com/prototypal.html).
In case anyone else finds this useful, here's how I sorted it out:
- "class-based" & "prototype-based" inheritance (Crockford refers to them as "classical" & "prototypal" inheritance). Different styles of instantiating objects.
- "closure pattern" & "prototypal pattern" (aka "prototypal inheritance" in this context). Different techniques for implementing class-based inheritance.
The mostly likely reason is probably familiarity. Most languages use the 'new' operator to create new objects, so it seems natural to follow the same pattern when creating a JS API that will likely be consumed by people who come from other languages.
The main advantage of Douglas Crockford's power constructor pattern is that it allows truly private variables or functions. I used to be adamant that this was the right way to go (and I still appreciate the pattern), but then I found that just following the convention of prefixing private members with an underscore worked fine--most people understand that it means "private". My code also started to look a little neater. All of my instance members are actually tied to the 'this' context object, rather being spread between nested functions or local variables declared within the constructors, and public/privileged methods declared on the new object itself.
That's really what I liked the most about the Backbone implementation. It stays very close to the standard JS pattern--essentially mirroring what someone would do if they wanted to setup the prototype chain and attach methods manually.
It asks you to name the constructor method 'constructor' (when it could've easily been called something short like 'init' instead, for brevity). This corresponds well with the standard 'constructor' property available on each object, which points back to the constructor function that created the object.
The '__super__' property is also a nice convenience, without doing something "fancy" like wrapping each method with logic that temporarily injects a 'super' property into the current instance for the duration of a method call. Although that's definitely clever and convenient, I prefer the simplicity of using '__super__'.
Interestingly enough, the fancy approach for calling "super()" is actually prohibitively expensive ... making any method call in a subclass far slower than it otherwise could be. I don't think it's a viable option for a baseline library.
CoffeeScript does have really nice syntax for OOP, but I think JavaScript deserves some lovin' too. Well-written JavaScript (such as Backbone) looks pretty beautiful. Another plus is that new devs (if you have to worry about that sort of thing) don't have to learn a new language.
Yes, that would be me. I'm still getting my head round Javascript, cant take something new on at the moment.
I havent even learned what inheritance is yet, so have no idea how Backbone.js would benefit me, even though im working on a project where i need to use a class.