[squeak-dev] open paren/brace/bracket...

Igor Stasenko siguctua at gmail.com
Sat Apr 19 02:12:02 UTC 2014


On 18 April 2014 05:11, Chris Muller <asqueaker at gmail.com> wrote:

> Thanks for that great explanation -- (my interest in in man-machine
> interfaces has always made this an interesting topic for me).
>
> I've got to say, I totally get you.  I know exactly how you feel
> because its exactly how I feel about "Auto Indent".  I drives me nuts
> in exactly the ways you've described about Auto Enclose, and for the
> same exact reasons.  It totally intrudes on my typing, disrupting my
> train of thought because its guessing wrong half the time and forcing
> me into a bunch of little "decisions" whether I need to press Tab or
> Backspace.  I know what I want to type, I just want to let-it-flow.
>
> This made me pause to ask, "so why do I like Auto Enclose so much, but
> not Auto Indent?"
>
> It's because of Squeak's amazing little collection of 2 or 3 editing
> features turn it into like a poor-mans Scratch.  You know, the ones
> we've been talking about:  1) selecting innards, 2) hot-key
> adding/removing of surrounding enclosures, 3) auto format.  Once using
> those, Auto Enclose rounds it out nicely, (and disabling
> selectionMayShrink boosts it even one more notch).
>
> >> You know, I bet this boils down to a simple cost-benefit analysis. For
> me,
> >> the effort required to
> >> type a character at the cursor position is negligible, so saving that
> >> effort is of little benefit. Even
> >> in cases where I will need to put a $) after the expression I'm typing
> >> now, sometimes I'll have to
> >> type right-arrow to get past it. So the benefit is very small and often
> >> offset by a small loss.
>
> It's not about saving keystrokes.  It's about automatic closure of
> multiple nested expressions.  Query's like this are almost impossible
> to "type" without Auto Enclose:
>
>
Usually, when this happens, this is a good sign that your code needs
refactoring.



>      ^ (cube
>           plot: [ : dim | dim date month ]
>           measures:
>                [ : meas |
>                (meas mean score plotNumber: 1)
>                , ((meas
>                     define: #fractionOfWinners
>                     as: [ : cell | cell total winnerCount / cell total
> count ]) plotNumber: 2)
>                , (meas mean gainFactor
>                     plotNumber: 3;
>                     colorizer: [ : val | val > 0 ifTrue: [Color green
> twiceDarker] ifFalse: [ Color red twiceDarker ] ]) ]
>           where:
>                [ : cell |
>                (cell dimension date year equalTo: Date today asYear)
>                | (cell dimension date year equalTo: Date today asYear
> previous) ]) open
>
> It'd be much more easily "assembled", expression by expression, but
> Auto Enclose gives typing it at least a chance of success.  :)
>
> >> Similarly, deleting an unwanted character is cheap, but deciding whether
> >> to do so is a huge cost.
> >> I have to stop thinking about what I'm doing, and think ahead to what
> I'm
> >> going to do next. Even
> >> if I know I'm going to need the closing character, it stays in my field
> of
> >> view and takes up cycles
> >> as a pending thing that I have to worry about until I complete the
> encoded
> >> expression.
>
> So I'm surprised you don't better appreciate the atomicity of
> expression-editing.  Deleting a paren/brace/quote character breaks the
> code and even breaks the formatter so you can get really stuck on
> complex expressions.  Taking an approach of expression-editing, one is
> determined not to let the code ever be broken even for a short period
> of time.
>
> >> So, the benefit is small and unreliable, while the cost is large and
> >> inevitable. It forces me to think
> >> about typing, which normally I don't have to do. Thus, it's infuriating.
>
> Yep, I totally get you.  But if you ever decide to try committing to
> Squeak's very capable expression-editing functions, I hope it'll work
> out as well for you as for me.
>
>


-- 
Best regards,
Igor Stasenko.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140419/c590a08d/attachment.htm


More information about the Squeak-dev mailing list