Content deleted Content added
→Module object equivalence: new section |
|||
Line 151:
[[Special:Contributions/109.145.82.159|109.145.82.159]] ([[User talk:109.145.82.159|talk]]) 17:23, 19 August 2011 (UTC)
<span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/109.145.82.159|109.145.82.159]] ([[User talk:109.145.82.159|talk]]) 17:17, 19 August 2011 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
== Module object equivalence ==
There's nothing dubious at all about this. A module is a collection of shared state (stored in module-level globals) combined with a set of functions that operate on that state. An object (in the sense of class instance) is a collection of shared state (stored in 'self') combined with a set of functions that operate on that state (i.e. methods). The only really substantial difference between the two is that -- generally -- modules can only be instantiated once, while there can be multiple instantiations of the same class. If no one disputes this, I'm deleting this tag.
|