[squeak-dev] MethodNodes on Monticello (was: The Inbox: Kernel-ct.1339.mcz)

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Nov 20 12:41:57 UTC 2020


Hi Eliot,


> You're not alone in this thought.  Until comments are part of the grammar it is likely a vain hope however.


Well, I suppose that this would be a quite architectonical change both in Compiler/Parser and on the Monticello/SqueakSource end ... But this could be a bit easier by installing a pretty-printer before committing and using pretty diffs in Monticello only (for certain repositories).

<http://www.hpi.de/>

> But another approach is to read Kent Beck's Smalltalk Best Practice Patterns and see if his arguments on formatting are persuasive.  This is as good a style guide as it gets.

I read them, and they are not bad at all.

> IMO, Smalltalk is not a curly-brace language.

Yep, and I hate to read this:

foo ifTrue: [
    "do something"
] ifFalse: [
    "do something else"
].

Still ...

> [ & ] delimit an object, not some statements.

The problem is that when writing the opening bracket on the same line as the first block statement, the block statements will look inconsistently intended:

someBoolean
    ifTrue:
        [self doOneThing.
        self doAnotherThing.
        "Do you notice the visual glitch above?"].

Also, Marcel has argued that it's harder to select the whole block content at once if you have to strip of the brackets before. However, the latter might also be a question of tools.

Best,
Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Eliot Miranda <eliot.miranda at gmail.com>
Gesendet: Freitag, 30. Oktober 2020 19:56 Uhr
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1339.mcz



On Wed, Oct 28, 2020 at 1:33 PM Christoph Thiede <christoph.thiede at student.hpi.uni-potsdam.de<mailto:christoph.thiede at student.hpi.uni-potsdam.de>> wrote:
Done, see Kernel-ct.1357.

Thanks!

Sometimes I believe we should store MethodNodes on Monticello only, or have
the code automatically formatted by the source.squeak.org<http://source.squeak.org> servers right
during uploading using a pretty printer ... :-)

You're not alone in this thought.  Until comments are part of the grammar it is likely a vain hope however.

But another approach is to read Kent Beck's Smalltalk Best Practice Patterns and see if his arguments on formatting are persuasive.  This is as good a style guide as it gets.  IMO, Smalltalk is not a curly-brace language. [ & ] delimit an object, not some statements.  But many of the original Smalltalkers formatted code as you do so I'm not right.  It's just that I've rewritten lots of the Kernel code and so I'm overly possessive.  I hope you're not offended.

_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201120/a9ab9474/attachment-0001.html>


More information about the Squeak-dev mailing list