[ENH] (?) Pretty Printing

Norton, Chris chrisn at Kronos.com
Thu Jan 20 19:45:13 UTC 2000


Hi Dean & company.

[I haven't tried your changes yet, but here's why I avoid pretty print]

I have been avoiding pretty printing, because it does (did?) things that
obfuscated the code for me.  For example, if you do an assignment as
follows:

test
    | tmp aCharacter |

    aCharacter _ $f.
    tmp _ ($a = aCharacter)
        ifTrue: ['right on!']
        ifFalse: [nil]

I believe this pretty prints to:

test
    | tmp aCharacter |
    aCharacter _ $f.
    tmp _ $a = aCharacter ifTrue: ['right on!']

OK.  There are some disturbing things here for me.  First off, I lost my
ifFalse: [nil].  This is bad, because, even though it may be the same code,
having the ifFalse: [nil] tells programmers (newbies esp.), that the false
case has been thought of and that the design is to have tmp set to nil.

Another thing I don't like about pretty printing is that it moved my ifTrue:
up a line.

I am a strong believer in standard formatting, however.  In VSE, you have
the option of auto formatting a method and saving it that way, without
having overall formatting thoughout the image.  If I could pretty print a
method and then save it, without having autoformatting on throughout Squeak,
I would be more inclined to use the feature.

Cheers & thanks!

---==> Chris





More information about the Squeak-dev mailing list