[squeak-dev] Code formatting patterns (was: The Trunk: Compiler-cmm.275.mcz)

Louis LaBrunda Lou at Keystone-Software.com
Fri Oct 4 21:44:58 UTC 2013


On Fri, 4 Oct 2013 17:07:09 +0200, Bert Freudenberg <bert at freudenbergs.de>
wrote:

>On 2013-10-04, at 16:58, Chris Muller <asqueaker at gmail.com> wrote:
>
>> Well, the new is taller and slimmer, with a consistent application of
>> Rectangular Block, a "best practice" formatting pattern.  I've never
>> found short and squat (and inconsistent!) to be easier to read than
>> tall & slim, but I guess we all have our visual acuity developed the
>> way it is developed.
>> method.
>> 
>> That's why I'd suggest to simply use pretty print when coming across a
>> method you find hard-to-read.
>> 
>> Also, if I make a small, one-line change to a method, I won't reformat
>> it out of respect for the prior author's format.  But if changes are
>> significant, it becomes "my" code and time is too scarce anyway to
>> spend time manually formatting code.  A Shift+Command+S just prior to
>> saving converts it to RB for me, which is easiest for most people to
>> read because, according to the pattern, people see things in
>> rectangles.
>
>
>Compare
>
>	[ undeclared at: sym put: nil ]
>		on: AttemptToWriteReadOnlyGlobal
>		do: [ :noti | noti resume: true ]
>
>to:
>
>	[ undeclared
>		at: sym
>		put: nil ]
>		on: AttemptToWriteReadOnlyGlobal
>		do: [ :noti | noti resume: true ]
>
>Isn't the first one much more "rectangular" and easier to read? I find the indentation in the second one irritating.
>
>- Bert -

+1

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com



More information about the Squeak-dev mailing list