The Inbox: Morphic-spd.507.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-spd.507.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-spd.507.mcz

==================== Summary ====================

Name: Morphic-spd.507
Author: spd
Time: 4 January 2011, 5:54:07.209 pm
UUID: c5d862d6-b70d-4ef2-b9e5-8018b9949701
Ancestors: Morphic-cmm.506

Added comments for TextMorph's #autoFit: and #wrapFlag:, which I find horrendously confusing.  They are  
probably badly named, but at minimum deserve better comments.

=============== Diff against Morphic-cmm.506 ===============

Item was changed:
  ----- Method: TextMorph>>autoFit: (in category 'accessing') -----
  autoFit: trueOrFalse
+ "Whether I automatically adjust my size to fit text as it changes"
+
  self isAutoFit = trueOrFalse ifTrue: [^ self].
+ self autoFitOnOff.!
- self autoFitOnOff!

Item was changed:
  ----- Method: TextMorph>>wrapFlag: (in category 'accessing') -----
  wrapFlag: aBoolean
+ "Whether contained text will adjust its bounds as I change shape:
+ | wrapFlag | TextMorph grows | TextMorph shrinks |
+ | true | wrapped lines fill new space | long lines wrap to fit |
+ | false |   wrapped lines stay same | long lines are cut off |"
- "Change whether contents are wrapped to the container."
 
  aBoolean == wrapFlag ifTrue: [^ self].
  wrapFlag := aBoolean.
  self composeToBounds!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-spd.507.mcz

Chris Muller-3
To make the new comment even more precise, how clarifying by the term
"autoFit" instead of "TextMorph grows".

Also, convention is to not end the last line with a period.

On Tue, Jan 4, 2011 at 4:54 PM,  <[hidden email]> wrote:

> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-spd.507.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-spd.507
> Author: spd
> Time: 4 January 2011, 5:54:07.209 pm
> UUID: c5d862d6-b70d-4ef2-b9e5-8018b9949701
> Ancestors: Morphic-cmm.506
>
> Added comments for TextMorph's #autoFit: and #wrapFlag:, which I find horrendously confusing.  They are
> probably badly named, but at minimum deserve better comments.
>
> =============== Diff against Morphic-cmm.506 ===============
>
> Item was changed:
>  ----- Method: TextMorph>>autoFit: (in category 'accessing') -----
>  autoFit: trueOrFalse
> +       "Whether I automatically adjust my size to fit text as it changes"
> +
>        self isAutoFit = trueOrFalse ifTrue: [^ self].
> +       self autoFitOnOff.!
> -       self autoFitOnOff!
>
> Item was changed:
>  ----- Method: TextMorph>>wrapFlag: (in category 'accessing') -----
>  wrapFlag: aBoolean
> +       "Whether contained text will adjust its bounds as I change shape:
> +               |       wrapFlag        |               TextMorph grows                 |               TextMorph shrinks       |
> +               |               true            | wrapped lines fill new space  |       long lines wrap to fit          |
> +               |               false           |   wrapped lines stay same             |       long lines are cut off          |"
> -       "Change whether contents are wrapped to the container."
>
>        aBoolean == wrapFlag ifTrue: [^ self].
>        wrapFlag := aBoolean.
>        self composeToBounds!
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-spd.507.mcz

Sean P. DeNigris
Administrator
Chris Muller-3 wrote
To make the new comment even more precise, how clarifying by the term
"autoFit" instead of "TextMorph grows".
I don't understand, would you say more?

Chris Muller-3 wrote
Also, convention is to not end the last line with a period.
Ha, I thumb my nose at convention!  Just kidding, but it is a matter of style.  Or when you say convention, do you mean in Squeak?  Although I've seen plenty of both ways.

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-spd.507.mcz

Tobias Pape
Am 2011-01-05 um 06:03 schrieb Sean P. DeNigris:

> […]
>
> Chris Muller-3 wrote:
>>
>> Also, convention is to not end the last line with a period.
>>
> Ha, I thumb my nose at convention!  Just kidding, but it is a matter of
> style.  Or when you say convention, do you mean in Squeak?  Although I've
> seen plenty of both ways.
>
> Sean

The convention _I_ learned is:

The last _statement_ is a return => no period
The last _statement_ is not a return => period

I think it's more important to be consistent.

So Long
        -Tobias


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-spd.507.mcz

Sean P. DeNigris
Administrator
Tobias Pape wrote
I think it's more important to be consistent.
I used to feel the same way, until I read Andres Valloud's excellent "Fundamentals of Smalltalk Programming Technique, Volume 1" (http://www.lulu.com/product/paperback/fundamentals-of-smalltalk-programming-technique-volume-1/5299835).  He has convinced me that the most powerful choice in projects such as Squeak is for each of us to train ourselves to be perfectly okay with *any* code style - it makes us and the system better.  Having said that, I will eat my own dog food and stop sneakily adding spaces before the first line and periods at the end of methods (my own preference) when I make fixes in the system :)

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-spd.507.mcz

Nicolas Cellier
2011/1/5 Sean P. DeNigris <[hidden email]>:

>
>
> Tobias Pape wrote:
>>
>> I think it's more important to be consistent.
>>
>
> I used to feel the same way, until I read Andres Valloud's excellent
> "Fundamentals of Smalltalk Programming Technique, Volume 1"
> (http://www.lulu.com/product/paperback/fundamentals-of-smalltalk-programming-technique-volume-1/5299835).
> He has convinced me that the most powerful choice in projects such as Squeak
> is for each of us to train ourselves to be perfectly okay with *any* code
> style - it makes us and the system better.  Having said that, I will eat my
> own dog food and stop sneakily adding spaces before the first line and
> periods at the end of methods (my own preference) when I make fixes in the
> system :)
>
> Sean

If I remember correctly, putting a period after a return was
considered as a syntax error in st80 v2.3 because no other statement
should follow a return.

Nicolas

> --
> View this message in context: http://forum.world.st/The-Inbox-Morphic-spd-507-mcz-tp3174576p3176183.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>