<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 4, 2013 at 8:07 AM, Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-10-04, at 16:58, Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br>
<br>
> Well, the new is taller and slimmer, with a consistent application of<br>
> Rectangular Block, a "best practice" formatting pattern. I've never<br>
> found short and squat (and inconsistent!) to be easier to read than<br>
> tall & slim, but I guess we all have our visual acuity developed the<br>
> way it is developed.<br>
> method.<br>
><br>
> That's why I'd suggest to simply use pretty print when coming across a<br>
> method you find hard-to-read.<br>
><br>
> Also, if I make a small, one-line change to a method, I won't reformat<br>
> it out of respect for the prior author's format. But if changes are<br>
> significant, it becomes "my" code and time is too scarce anyway to<br>
> spend time manually formatting code. A Shift+Command+S just prior to<br>
> saving converts it to RB for me, which is easiest for most people to<br>
> read because, according to the pattern, people see things in<br>
> rectangles.<br>
<br>
<br>
</div>Compare<br>
<br>
[ undeclared at: sym put: nil ]<br>
on: AttemptToWriteReadOnlyGlobal<br>
<div class="im"> do: [ :noti | noti resume: true ]<br>
<br>
</div>to:<br>
<br>
[ undeclared<br>
at: sym<br>
put: nil ]<br>
on: AttemptToWriteReadOnlyGlobal<br>
<div class="im"> do: [ :noti | noti resume: true ]<br>
<br>
</div>Isn't the first one much more "rectangular" and easier to read? I find the indentation in the second one irritating.<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="HOEnZb"><font color="#888888"><br>
- Bert -<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> On Fri, Oct 4, 2013 at 6:06 AM, Bert Freudenberg <<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>> wrote:<br>
>> On 2013-10-03, at 23:02, Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br>
>><br>
>>> The reformatting caused almost all lines to be dif'd. The only change<br>
>>> is handling AttemptToWriteReadOnlyGlobal on the at:put:.<br>
>><br>
>> I find the compact form the code had before a lot more readable.<br>
>><br>
>> - Bert -<br>
>><br>
>>><br>
>>> On Thu, Oct 3, 2013 at 2:35 PM, <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
>>>> Chris Muller uploaded a new version of Compiler to project The Trunk:<br>
>>>> <a href="http://source.squeak.org/trunk/Compiler-cmm.275.mcz" target="_blank">http://source.squeak.org/trunk/Compiler-cmm.275.mcz</a><br>
>>>><br>
>>>> ==================== Summary ====================<br>
>>>><br>
>>>> Name: Compiler-cmm.275<br>
>>>> Author: cmm<br>
>>>> Time: 3 October 2013, 2:34:56.409 pm<br>
>>>> UUID: 9d002330-e75e-436f-8699-b29413e98e81<br>
>>>> Ancestors: Compiler-nice.274<br>
>>>><br>
>>>> When loading code, don't blow up just because of an undeclared ref.<br>
>>>><br>
>>>> =============== Diff against Compiler-nice.274 ===============<br>
>>>><br>
>>>> Item was changed:<br>
>>>> ----- Method: Encoder>>undeclared: (in category 'encoding') -----<br>
>>>> + undeclared: name<br>
>>>> - undeclared: name<br>
>>>> | sym |<br>
>>>> requestor interactive ifTrue:<br>
>>>> + [ requestor requestor == #error: ifTrue: [ requestor error: 'Undeclared' ].<br>
>>>> + ^ self notify: 'Undeclared' ].<br>
>>>> - [requestor requestor == #error: ifTrue:<br>
>>>> - [requestor error: 'Undeclared'].<br>
>>>> - ^self notify: 'Undeclared'].<br>
>>>> "Allow knowlegeable clients to squash the undeclared warning if they want (e.g.<br>
>>>> Diffing pretty printers that are simply formatting text). As this breaks<br>
>>>> compilation it should only be used by clients that want to discard the result<br>
>>>> of the compilation. To squash the warning use e.g.<br>
>>>> [Compiler format: code in: class notifying: nil decorated: false]<br>
>>>> on: UndeclaredVariableWarning<br>
>>>> do: [:ex| ex resume: false]"<br>
>>>> sym := name asSymbol.<br>
>>>> + ^ (UndeclaredVariableWarning new<br>
>>>> + name: name<br>
>>>> + selector: selector<br>
>>>> + class: cue getClass) signal<br>
>>>> - ^(UndeclaredVariableWarning new name: name selector: selector class: cue getClass) signal<br>
>>>> ifTrue:<br>
>>>> + [ | undeclared |<br>
>>>> - [| undeclared |<br>
>>>> undeclared := cue environment undeclared.<br>
>>>> + [ undeclared<br>
>>>> + at: sym<br>
>>>> + put: nil ]<br>
>>>> + on: AttemptToWriteReadOnlyGlobal<br>
>>>> + do: [ : noti | noti resume: true ].<br>
>>>> + self<br>
>>>> + global: (undeclared associationAt: sym)<br>
>>>> + name: sym ]<br>
>>>> - undeclared at: sym put: nil.<br>
>>>> - self global: (undeclared associationAt: sym) name: sym]<br>
>>>> ifFalse:<br>
>>>> + [ self<br>
>>>> + global: (Association key: sym)<br>
>>>> + name: sym ]!<br>
>>>> - [self global: (Association key: sym) name: sym]!<br>
>>>><br>
>>>><br>
>>><br>
>><br>
>><br>
>><br>
>><br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>