string write stream

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

string write stream

Peter Uhnak
What is better?

String new writeStream
or
WriteStream on: String new
or
WriteStream on: ''

by popularity '' is the winner, however apparently not everyone is happy with that 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f := Finder new.
(f sourceSearch: 'WriteStream on: ''''') size. "51"
(f sourceSearch: 'String new writeStream') size. "48"
(f sourceSearch: 'WriteStream on: String new') size. "39"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While this is not a popularity contest, we can at least poll for preferences https://strawpoll.me/5153067 :)

Peter
Reply | Threaded
Open this post in threaded view
|

Re: string write stream

CyrilFerlicot
Le 08/08/2015 12:42, Peter Uhnák a écrit :

> What is better?
>
> String new writeStream
> or
> WriteStream on: String new
> or
> WriteStream on: ''
>
> by popularity '' is the winner, however apparently not everyone is happy
> with that
> https://pharo.fogbugz.com/f/cases/15260/WriteStream-on-new-string
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> f := Finder new.
> (f sourceSearch: 'WriteStream on: ''''') size. "51"
> (f sourceSearch: 'String new writeStream') size. "48"
> (f sourceSearch: 'WriteStream on: String new') size. "39"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> While this is not a popularity contest, we can at least poll for
> preferences https://strawpoll.me/5153067 :)
>
> Peter
What do I do if I do '' writeStream ? :)

--
Cheers
Cyril


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: string write stream

stepharo
In reply to this post by Peter Uhnak


Le 8/8/15 12:42, Peter Uhnák a écrit :
What is better?

String new writeStream
I prefer this one because the class of the stream is not hardcoded in my code :)




or
WriteStream on: String new
or
WriteStream on: ''

by popularity '' is the winner, however apparently not everyone is happy with that 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f := Finder new.
(f sourceSearch: 'WriteStream on: ''''') size. "51"
(f sourceSearch: 'String new writeStream') size. "48"
(f sourceSearch: 'WriteStream on: String new') size. "39"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While this is not a popularity contest, we can at least poll for preferences https://strawpoll.me/5153067 :)

Peter

Reply | Threaded
Open this post in threaded view
|

Re: string write stream

Mariano Martinez Peck
In reply to this post by Peter Uhnak


On Sat, Aug 8, 2015 at 7:42 AM, Peter Uhnák <[hidden email]> wrote:
What is better?

String new writeStream

Prefer this one, as Stef said. 
 
or
WriteStream on: String new

Use this one only if you want to specify which type of stream. 
 
or
WriteStream on: ''

This is the worst. It won't work in GemStone for example, because '' is a literal. 
 

by popularity '' is the winner, however apparently not everyone is happy with that 


 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
f := Finder new.
(f sourceSearch: 'WriteStream on: ''''') size. "51"
(f sourceSearch: 'String new writeStream') size. "48"
(f sourceSearch: 'WriteStream on: String new') size. "39"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While this is not a popularity contest, we can at least poll for preferences https://strawpoll.me/5153067 :)

Peter



--