We all want to escape from routine, tedious and repeatable tasks..
But unfortunately there is some of them when it is going to stay no matter how you want to optimize, and implementing printing is one of good examples of such tasks.

Adding 'convenience' methods won't help.. it will just balkanize new printing stuff from one that lies there for years. In thousands of projects.. because it is one of the central necessities, to see what your objects contain or to report something somewhere in readable form, and that involves *drumroll* printing :)

On 27 July 2015 at 15:15, Igor Stasenko <siguctua@gmail.com> wrote:


On 27 July 2015 at 12:23, stepharo <stepharo@free.fr> wrote:
May be I raised a not important issue.

My impression too. :)

��
Stef

Le 27/7/15 09:53, Peter Uhn��k a ��crit��:

stream surround: aBlock between: '( '�� and: ' )'

This may be personal preference, but I do not like having more method arguments after a block argument... because if the block is longer it may not be visible...
e.g.

stream
surround: [ :aStream |��
self size > 100
ifTrue: [��
aStream nextPutAll: 'size '.
self size printOn: aStream ]
ifFalse: [��
self keysSortedSafely
do: [ :key |��
aStream
print: key;
nextPutAll: '->';
print: (self at: key);
space ] ] ]
between: $(
and: $)

vs between:and:surround:

if you actually run this through formatter in Pharo, the between:and: is not even visible --- you have to scroll to see it. Of course if aBlock is a variable, than my argument falls.

From visual perspective the current state actually isn't that bad because you immediately see where is beginning and where is end without even looking... with surround:between:and: not so much...

Peter




--
Best regards,
Igor Stasenko.



--
Best regards,
Igor Stasenko.