pipe
Fabio Filasieno
fabio.filasieno at gmail.com
Sat Aug 25 19:20:42 UTC 2007
On Aug 25, 2007, at 8:40 PM, Jason Johnson wrote:
> This is a bit contrived. If you ever did find the need to do this it
> should look like:
>
>
> (((((((((((obj message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param
>
> Code smell to be sure, but you pile what you don't like on one line
> and say you can't read it while formatting what you do like and saying
> "see!".
To me there is not much difference between ...
> (((((((((((obj message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param)
> message1: param)
> message2:param
and
> (((((((((((obj message1: param) message2:param) message1: param)
> message2:param) message1: param) message2:param) message1: param)
> essage2:param) message1: param) message2:param) message1: param)
> message2:param
1. They both suck ...
2. While writing and thinking ... I have always to stop and think ...
"ok, now where do I need to put the bloody parenthesis"
>
>> The pipe is needed to support a pipe&filter style of programming.
>> That
>> perfectly works with Smalltalk syntax, and truly
>> opens up a better way of doing functional transformations.
>
> pipe&filter style of programming? Most people call this "functional
> programming" and it doesn't require a pipe operator to work. Such an
> operator can make certain code cleaner to be sure, but it doesn't
> "open up a better way of doing functional transforms" by any means.
> Just saves you one character per function call.
I call it too functional programming ... but there are many
definitions of it ...
for somebody functional programming is no side-effects and nothing else,
for others higher order functions is ok ...
since I didn't want to get into that, I just said pipe&filters ... i
thought it was alright ... thanks for this clarification ... now
everybody now we are talking about ...
> Such an operator can make certain code cleaner to be sure, but it
> doesn't
> "open up a better way of doing functional transforms" by any means.
> Just saves you one character per function call.
Not only it can make " certain code cleaner" , but It changes the way
you think, because it's like the full stop in regular English ...
Simple train of thought example ...
----
>>here I'm Thinking<<
here I'm doing
----
>>ok so what do I have to do ... first get I get some objects<<<
storage getSomeObject >> than .... (and I put my pipe symbol ) ...
put a PIPE <<
|
Already here it cool ...I don't have to ... think .. "Gee I need to
go back and put a parenthesis .."
........
storage getSomeCollection >> than .... aaaaand PIPE <<
| filter: [:obj | obj creationDate >10] >>>>> some
more mumble mumble .... aaaaaand PIPE<<
| collect: [:obj | obj.name] >>>> some more
mumble mumble .... and PIPE <<
>> .... her some more mumble mumble .... because I'm not sure what
to do BUT
I do know that I've got some names.... I never need to go back and
put parenthesis .. and this does not break my thoughts ....<<<<
......
storage getSomeCollection >>> than .... (and I put my pipe symbol )
<<<
| filter: [:obj | obj creationDate >10] >>>>>
than .... (and I put my pipe symbol )... and PIPE <<
| collect: [:obj | obj.name] >>>>than .... (and
I put my pipe symbol )... and PIPE<<
| filter: [:name | name isFemale ]
| filter: [:name | beutifullGirlsDB contains:name ]
| do: [:name | mailTo: (beutifullGirlsDB
getWithName:name) message: "What are you doing tonight ?" ]
>>>mmm ... I could do a few things better ... filter and collect
less ... so I'll do another pass ....
At this point I might write a Unit test and later I'll make it
faster ...
etc etc ....<<<
---------------------------------
To me it's like a full stop in english. Maybe you are different. But
I think that most people like full stops when a sentence ends.
The pipe is the full stop ... ready to start the next manipulation ...
Fabio Filasieno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20070825/ce564d3d/attachment.htm
More information about the Squeak-dev
mailing list
|