<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 1, 2016 at 1:45 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
&gt; On 01.06.2016, at 17:46, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;&gt; The predominant style in Squeak historically has been<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;        coll do: [:each | each do something]<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Ken Beck uses that in his “Best Practice Patterns” too. It’s also produced<br>
&gt;&gt;&gt; by our formatter (but we rarely use that because it introduces weird line<br>
&gt;&gt;&gt; breaks).<br>
&gt;<br>
&gt; Actually, Kent Beck advocates a Rectangular Block formatting pattern,<br>
<br>
</span>I was mostly talking about the issue at hand, namely, whether to put spaces inside of the brackets. Which he does not do.<br>
<br>
This is (not entirely by coincidence) the typographical convention in English, too.<br>
<br>
That’s why I prefer it, independent of rectangular blocks or not.<br>
<span class=""><br>
&gt; which is NOT produced by our formatter, unless you merge<br>
&gt; Compiler-cmm.179 (which I&#39;ve just recopied to the Inbox).  I wasn&#39;t<br>
&gt; successful in convincing the community to adopt it six years ago.<br>
&gt;<br>
&gt; Besides the reasons already documented by Kents pattern, I like RB<br>
&gt; because it presents a semi-&quot;tiled&quot; view of the code similar to<br>
&gt; Scratch, but with textual, rather than graphical, tiles.  Like this:<br>
&gt;<br>
&gt;      coll do:<br>
&gt;            [ :each |<br>
&gt;            statement1.<br>
&gt;            (condition1) ifTrue: [ statement2 ] ]<br>
&gt;<br>
<br>
</span>I’d write it Kent Beck-style, namely<br>
<span class=""><br>
<br>
    coll do:<br>
           [:each |<br>
           statement1.<br>
           (condition1) ifTrue: [statement2]]<br></span></blockquote><div><br></div><div>+1</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
</span>or maybe<br>
<span class=""><br>
    coll do: [:each |<br>
           statement1.<br>
           (condition1) ifTrue: [statement2]]<br></span></blockquote><div><br></div><div>-1.  Blocks braces should delineate rectangular areas for us visual thinkers.  So it&#39;s fine if it fits on one line, but if it fits on two, break to a new line and indent please.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
&gt; It is so much more OO than &quot;textual&quot; formatting like this:<br>
&gt;<br>
&gt;      coll do: [ :each |<br>
&gt;             statement1.<br>
&gt;             (condition1) ifTrue: [<br>
&gt;                    statement2.<br>
&gt;             ]<br>
&gt;      ]<br>
<br>
</span>Agreed. I don’t think I’ve seen much of this style in Squeak. It’s ugly.<br></blockquote><div><br></div><div>All to much of it exists in some places I won&#39;t illuminate.  Agreed; I find it both horribly ugly and wasteful of screen real estate.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
<br>
&gt; I really don&#39;t notice any predominant style among different authors of<br>
&gt; Squeak,<br>
<br>
</span>I do. Anything that’s not written in that style looks jarring to me. Like Andreas’ habit of omitting the space between a keyword message and a block (ifTrue:[foo]).<br></blockquote><div><br></div><div>+1.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
&gt; and I don&#39;t think attempting to establish any kind of<br>
&gt; formatting standard or style would be counterproductive for the<br>
&gt; community (not that anyone is suggesting that).  Instead, its probably<br>
&gt; best to let our individual imaginations flow the way they do, and let<br>
&gt; the IDE take care of each of us individually.  Methods can be quickly<br>
&gt; and easily formatted on access and/or save.  However, I do recommend,<br>
&gt; if one is only changing only one or two lines of a longer method, they<br>
&gt; should try to maintain the prior author&#39;s format.  Also, never submit<br>
&gt; a change to trunk that ONLY changes the formatting of a method,<br>
&gt; please.<br>
<br>
</span>IMHO readability suffers wth mixed styles. Be creative in your coding, not in your formatting. I think it would be a good idea to adopt a style guide. Beck’s would be a good starting point.<br></blockquote><div><br></div><div>+1.  But having a good formatter which can implement Kent&#39;s style guide would be nice.  We&#39;re not there yet.</div><div> </div><div>I wonder if we should include a précis of Kent;s guide in a workspace window in new releases.  We could put a short guide/cheat sheet in one, and a formatting guide in another.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">- Bert -</font></span><br></blockquote></div><br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>