I think of Beck's Rectangular Block as like a textual representation of Scratch tiles. It's about presenting the code-structure, rather than aligning text on tabs. However, I do think his Indented Control Flow actually preserves _horizontal_ space at the expense of vertical space. I've found myself eschewing that particular pattern more and more in my last couple of years of coding. Spreading (1 to: 10) across two lines seems kinda crazy. But that book is a must-read for newcomers interested in writing quality Smalltalk, IMO. Not even for the formatting chapter, but the other ones which teach the "shoulds" and "should nots" that may not be obvious to a student, like avoiding different super send. - Chris
On Thu, Jul 4, 2019 at 11:58 PM Norbert Hartl <norbert@hartl.name> wrote:
Sometimes I wonder when I change a piece of code in pharo if there is an official formatting guide line. Is the formatter in calypso the incarnation of it or how code is supposed to be formatted in the offical image?
I just see tons of occurrences where caret immediately follows a token and such which I donât like at all.
There are many styles, many opinions. Kent Beck presents a well argued set of rules that work for visual thinkers like me; the main thing I like is rectangular blocks.
Kent Beck Best Practice Patters <http://stephane.ducasse.free.fr/FreeBooks/BestSmalltalkPractices/Draft-Small...> p 126 onwards
As Kent says
"The priorities of these patterns are: 1. To make the gross structure of the method apparent at a glance. Complex messages and blocks, in particular, should jump out at the reader.
2. To preserve vertical space. There is a huge difference between reading a method that fits into the text pane of a browser and reading one that forces you to scroll. Keeping methods compact vertically lets you have smaller browsers and still be able to read methods without scrolling. This reduces window management overhead and leaves more screen space for other programming tools."
_,,,^..^,,,_ best, Eliot