<div>Maybe we should have a package comment that describe how the whole structure is so it&#39;s easier to </div>
<div>get hunch of where to start looking for a certain functionality.</div>
<div> </div>
<div>Karl</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Tue, Jan 22, 2013 at 10:23 AM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br>

<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">IMO, the fact that code is crystal clear is not a good reason to omit<br>documentation.<br>There is also an effect of volume.<br>
The fact that MC is huge makes it impossible to embrass its overall<br>structure for a newcomer.<br><br>Often in Smalltalk, we pick up a very small detail, like this case of<br>cleaning a cache, and have to reconstruct a mental image of MC<br>
architecture from bottom-up. Where is this class used, and its cache?<br>Class comments at least help a lot along this track.<br><br>I learned Smalltalk ith st-80 v2.3 and st-V, and I can say that<br>comments were not omitted in these distributions. Though the volume of<br>
code was well below current Squeak trunk.<br>I&#39;m not sure that increase of volume combined with lack of coments<br>makes beginner&#39;s life easier.<br><br>Nicolas<br><br><br>2013/1/22 Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;:<br>

<div class="HOEnZb">
<div class="h5">&gt; Am 21.01.2013 um 22:29 schrieb &quot;H. Hirzel&quot; &lt;<a href="mailto:hannes.hirzel@gmail.com">hannes.hirzel@gmail.com</a>&gt;:<br>&gt;<br>&gt;&gt; Thank you Bert for these concise answers. They will make up a good<br>
&gt;&gt; bases for the comment.<br>&gt;&gt;<br>&gt;&gt; A follow up question:<br>&gt;&gt;<br>&gt;&gt; At which occasion is a snapshot done and what purpose does it serve?<br>&gt;<br>&gt; A snapshot is how MC models the contents of a package. Saving a package means storing a snapshot of it. Loading means taking another snapshot of what&#39;s currently in the image and comparing it to the stored snapshot, then filing in just the differences between the two.<br>
&gt;<br>&gt; The MC code base is actually very readable, you should try having a look at it. Nice example of OO design. I found the code to not even need extensive comments, it is perfectly understandable without.<br>&gt;<br>
&gt; - Bert -<br>&gt;<br>&gt;<br>&gt;&gt; --Hannes<br>&gt;&gt;<br>&gt;&gt; On 1/21/13, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; On 21.01.2013, at 13:40, &quot;H. Hirzel&quot; &lt;<a href="mailto:hannes.hirzel@gmail.com">hannes.hirzel@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; And as we are at it<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;   <a href="http://bugs.squeak.org/view.php?id=7560" target="_blank">http://bugs.squeak.org/view.php?id=7560</a><br>&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Monticello-Base contains the three classes<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; MCDefinition<br>&gt;&gt;&gt;&gt; MCPackage<br>&gt;&gt;&gt;&gt; MCSnapshots<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; All class comments are empty.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; A definition is a model for Smalltalk code. A package snapshot is a<br>&gt;&gt;&gt; collection of these definitions.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; What is the relationship between MCPackage and PackageInfo.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; MCPackage uses PackageInfo to find out which methods and classes belong to a<br>&gt;&gt;&gt; package.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; What does<br>&gt;&gt;&gt;&gt;  MCDefinition clearInstances.<br>
&gt;&gt;&gt;&gt; do?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; It nils out the quick-access cache to its subinstances. #allInstances is<br>&gt;&gt;&gt; very slow as it needs to scan the whole object memory, whereas retrieving an<br>
&gt;&gt;&gt; instance from the &quot;instances&quot; WeakSet is O(1).<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Why can this be done safely?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Because re-using a definition is only a space optimization.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; What is the impact of doing this?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; When loading/creating another snapshot, the definitions that are in both<br>&gt;&gt;&gt; snapshots will not be shared but occupy space twice.<br>
&gt;&gt;&gt;<br>&gt;&gt;&gt; - Bert -<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; --Hannes<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On 1/21/13, Nicolas Cellier &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt; Trying to chasePointers of MCDefinition allSubInstances, I saw several<br>&gt;&gt;&gt;&gt;&gt; instances of MCPatchBrowser, MCVersionInspector, ...<br>&gt;&gt;&gt;&gt;&gt; Though no such window is opened in my World, what&#39;s up?<br>
&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; If I chase pointers of one of these ghost MCPatchBrowser keys, I see<br>&gt;&gt;&gt;&gt;&gt; nothing but the opened inspectors and ObjectDependentsFields...<br>&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; I guess this must be exactly the same bug as<br>&gt;&gt;&gt;&gt;&gt; <a href="http://bugs.squeak.org/view.php?id=7119" target="_blank">http://bugs.squeak.org/view.php?id=7119</a> (see my own comments).<br>
&gt;&gt;&gt;&gt;&gt; The key of DependentsFields are weak, so they should be reclaimed.<br>&gt;&gt;&gt;&gt;&gt; But what if the value points somehow to the key (no matter how deep)?<br>&gt;&gt;&gt;&gt;&gt; Well, the key will never be reclaimed then.<br>
&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; I don&#39;t feel comfortable with these dependencies... It&#39;s a nest of<br>&gt;&gt;&gt;&gt;&gt; problems.<br>&gt;&gt;&gt;&gt;&gt; In MVC, the dependents were maintained in model, so a cycle would be<br>
&gt;&gt;&gt;&gt;&gt; garbageCollected more easily...<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Nicolas<br>&gt;&gt;<br>&gt;<br><br></div></div></blockquote></div><br>