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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Wed Apr 7 16:12:47 UTC 2021


The only other example I was thinking of would be multi-line comments, but I dislike them anyway. :-)


Yes, speaking generally, subjective coding style preferences are a problem when writing or maintaining code in a community. I am still convinced that it would be the best solution to remove specific styling information from the Trunk code base and apply it on everyone's end only according to their personal preferences. With prettyDiff, which is already fairly well supported, and a good pretty-printer, this should be a feasible endeavor. PoppyPrint looks very promising to me in this regard.


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jakob Reschke <jakres+squeak at gmail.com>
Gesendet: Mittwoch, 7. April 2021 18:04:32
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Elastic Tabstops (was Re: Need better default code font)

Hi,

The problem is, if it were a preference, for which setting will you write the Squeak Trunk code? A per-package setting dictated by the package maintainer sounds more practical to me, though it tends towards overengineering already.

The idea of elastic tabstops sounds good to me, but I have no practical experience with it. For the left-side-only indentation, I guess it will only make a difference if somebody wants a block with hanging indent like this:

    | sum count |
    sum := anInteger.
    count := 0.
    aCollection do: [:each | sum := sum + each.
                                          count := count + 1].
    "The first occurrences of sum and count are supposed to be left-aligned on the two lines above."

The example applies analogously if you want to start the remaining lines of the block at or just right of the [ of its first line and put the sum-mation on its own line.

Do you see other practical differences for our coding habits, everyone?

Kind regards,
Jakob


Am Mi., 7. Apr. 2021 um 17:31 Uhr schrieb Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de<mailto:Christoph.Thiede at student.hpi.uni-potsdam.de>>:

> 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<mailto:squeak-dev-bounces at lists.squeakfoundation.org>> im Auftrag von Tobias Pape <Das.Linux at gmx.de<mailto: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<mailto: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<mailto: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<mailto: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/c9f83ee9/attachment.html>


More information about the Squeak-dev mailing list