[squeak-dev] Elastic Tabstops (was Re: Need better default code font)

Vanessa Freudenberg vanessa at codefrau.net
Wed Apr 7 16:22:16 UTC 2021


Guess you misunderstood - this does not affect indentation at all, it only
affects the rendering of tabs following non-space characters in a line. And
indeed there could be a preference to render those tabs as a space instead,
however, that would probably lead to those text blocks being messed up
accidentally.

The Smalltalk environment was meant to provide rich text rendering. We had
text that could flow around objects at some point, that could flow along a
curve, that could embed bitmaps and even arbitrary morphs. For some reason
we went back to more or less plain text at least for code. I partly blame
Monticello which did not preserve the rich formatting that the style chunks
in the fileout format supported. I do find that unfortunate, however, and
would love to get some richness back.

Tabbed comments are similar to  traditional type-setting’s margin notes,
that can be used to write table-like data, etc. You don’t have to use them,
but I’m convinced it would make our codebase look a lot better.

Similarly, there’s no need for double quotes around comments. Comments
should simply use a different font. Not coincidentally, that is exactly how
commented code used to be printed in books. We only need the quotes for
typing, and maybe for exporting, but otherwise I wouldn’t mind to never see
them again.

My point being that Smalltalk source code is not plain text. Never has
been. It shouldn’t be treated as such. IMHO.

Vanessa

On Wed, Apr 7, 2021 at 08:31 Thiede, Christoph <
Christoph.Thiede at student.hpi.uni-potsdam.de> wrote:

> > I would 💜 love 💜 if we had elastic tabstops by default in our code
> editors.
>
> -1 for making this default behavior. :-) I think this is a matter of
> taste, but personally, I am not a friend of code that is not strictly
> left-justified, it just feels like wasted space to me.
> Please let's make it an optional preference.
>
> Best,
> Christoph
>
> ------------------------------
> *Von:* Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im
> Auftrag von Tobias Pape <Das.Linux at gmx.de>
> *Gesendet:* Montag, 5. April 2021 22:39:10
> *An:* The general-purpose Squeak developers list
> *Betreff:* Re: [squeak-dev] Elastic Tabstops (was Re: Need better default
> code font)
>
>
>
> > On 5. Apr 2021, at 22:37, Vanessa Freudenberg <vanessa at codefrau.net>
> wrote:
> >
> > Since we're on the subject of how our code looks:
> > I would 💜 love 💜 if we had elastic tabstops by default in our code
> editors.
> > This would eliminate (IMHO) the biggest counter-argument to using
> proportional fonts.
> >
>
> +100
> -t
> >
> >
> > Vanessa
> >
> > On Sat, Apr 3, 2021 at 12:55 PM Vanessa Freudenberg <
> vanessa at codefrau.net> wrote:
> > I just fixed a typo that went unnoticed for ~9 years (see
> KernelTests-codefrau.395). Even when Levente revised the code in 2015, he
> did not spot it:
> >
> > <image.png>
> >
> > IMHO (speaking as a typo nerd) this is due to our default code font not
> having distinct enough letter shapes. I very much like our use of a
> proportional font, but maybe it's time to switch to a different one?
> >
> > - Vanessa -
> >
> > On Sat, Apr 3, 2021 at 12:06 PM <commits at source.squeak.org> wrote:
> > Vanessa Freudenberg uploaded a new version of KernelTests to project The
> Trunk:
> > http://source.squeak.org/trunk/KernelTests-codefrau.395.mcz
> >
> > ==================== Summary ====================
> >
> > Name: KernelTests-codefrau.395
> > Author: codefrau
> > Time: 3 April 2021, 12:06:03.17026 pm
> > UUID: 062e8b73-a62e-46ce-af80-0dbb34c2f8dc
> > Ancestors: KernelTests-mt.394
> >
> > Fix typo in CompiledMethodComparisonTest.
> >
> > =============== Diff against KernelTests-mt.394 ===============
> >
> > Item was changed:
> >   ----- Method: CompiledMethodComparisonTest>>testHash (in category
> 'tests') -----
> >   testHash
> >         <timeout: 120>
> >
> >         | ai |
> >         ai := CompiledMethod allInstances.
> >         "We assume here that if two CompiledMethods are equal then they
> have the same size and header."
> >         (ai groupBy: [ :method | { method size. method header } ]) values
> >                 replace: [ :each | each asArray ];
> >                 do: [ :methods |
> >                         1 to: methods size do: [ :i |
> >                                 i to: methods size do: [ :j |
> >                                         (methods at: i) = (methods at:
> j) ifTrue: [
> > +                                               self assert: (methods
> at: i) hash equals: (methods at: j) hash ] ] ] ]
> > -                                               self assert: (methods
> at: i) hash equals: (methods at: i) hash ] ] ] ]
> >                 displayingProgress: 'Testing hashes'.
> >         self assert: (ai collect: [ :cm | cm hash ] as: Set) size * 2 >=
> ai asSet size!
> >
> >
> >
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210407/034b8d6c/attachment-0001.html>


More information about the Squeak-dev mailing list