mrdoob/three.js — pull request #2947 by bhouston (2013-01-18 16:21:01+00:00)
Title: Testing what Three.js would look like if it adopted the THREE.extend pattern across the whole library

I've applied the THREE.extent pattern across a large part of the library just to see what it would look like. I just did this as a thought experiment, so this isn't a very serious PR, I expect it to get rejected and I am okay with that.

Benefits:
- Consistent class declarations, one can use the pattern ```{ method1: function() {...}, method2: function() {...} }``` in all situations now.
- three.min.js shrunk by ~1% because of less duplication of the pattern ```THREE.ClassName.prototype.method = function() {...}```.

Downsides:
- three.js grew by 4% because the pattern ```{ method1: function() {...}, method2: function() {...} }``` requires one additional level of tab indentation over the pattern ```THREE.ClassName.prototype.method = function() {...}```.
- Possibly slower to initialize the library because classes have to be processed via THREE.extend, but I wasn't able to determine if this is the case.

I don't think that THREE.extend() will hard for others to understand if it is applied across the whole library in a consistent fashion. I think the challenge comes if it is only applied in some cases and not in others, then one has to explain both patterns to new comers rather than just one style.

This was just an experiment so I don't mind if this PR isn't accepted. I was just playing around this morning.