> On 26.11.2014, at 17:32, Ben Coman <b...@openinworld.com> wrote:
> 
> Yuriy Tymchuk wrote:
>> Hi everyone!
>> There is a Lint rule that suggests to use stream instead of strings 
>> concatenation. What is the most common way, to create a string this way, 
>> because the only thing I can come up with is:
>> String streamContents: [ :stream |
>>      stream
>>              nextPutAll: 'Hello';
>>              nextPut: $ ;
>>              nextPutAll: 'World’]
>> But I’m not sure if it is the preferred solution.
>> Cheers
>> Uko
> 
> This is typical advise, but previous discussion found it to be not 
> necessarily true.
> 
> https://www.mail-archive.com/pharo-dev@lists.pharo.org/msg08162.html
> 

Very good advice, thanks Ben!

> Perhaps the rule should be ammended/deleted.

Maybe a metric can be derived from Sven’s observations, e.g. “don’t apply if 
the strings are constants” etc. I don’t think the rule should be deleted 
because in the general case it’s important to understand that streams can be 
more efficient.

> cheers -ben
> 
> 


Reply via email to