Conversation
|
Good save. Could you move the bad example above the good example? Just for consistency sake. |
|
Good point; but what about when initially composing the object, when you're defining a large amount on the prototype for the first time (assuming no inheritance)? Also, does that open up the doors to making monkeypatching acceptable? |
|
Re: defining the class for the first time: defining on the existing prototype still works just as well at class definition time as overwriting the prototype. Gzip does a great job at getting rid of those Re: monkeypatching: good god no. Adding a guide about that can be a separate pull request, though. |
|
Whoops, accidental close. I'm with Matt on this. I'm scared of making assumptions about inheritance. |
|
For real close this time. Fixed: @b2c7d3d |
Overwriting the prototype makes inheritance impossible: you'll overwrite the base class with your methods. I switched the recommended ways of writing methods so that we don't make it impossible to use inheritance.