<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Aug 26, 2007, at 10:16 AM, danil osipchuk wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I think the subject should not be compared directly with unix pipes.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Unix pipes represent a way to reuse fixed parts of functionality -</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">compiled programs. These are black boxes. As a result application</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">logic for a shell script goes directly to the script itself which is</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">flat.</FONT></P></BLOCKQUOTE><DIV><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Smalltalk is very different - you always can add behaviour you</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">need to the other object and the application logic is distributed</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">across the system. <BR style=""></DIV></BLOCKQUOTE><BR class="khtml-block-placeholder"></DIV><DIV>That's not the point, but you are right, Unix and Smalltalk are different.</DIV><DIV>In regard to the black boxes thing.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>self is the input of a process which is defined the class of self.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The dispatch system when I do:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>obj doSomeStuff</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>will send obj to a process called doSomeStuff.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>self is the input of process.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ps -aux | grep 'fabio' | sort </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>is like:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Squeak ps: 'aux' | grep: 'fabio' | sort</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But this could be more object oriented in the sense that we are not passing </DIV><DIV>text but objects. It could be better factored.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>What objects give you is .... polymorphism.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This way you don't have to write</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is Unix (or C style) style .</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>MyData_doSomeStuff</DIV><DIV>MyOtherData_doSomeStuff</DIV><DIV>MySomeOtherData_doSomeStuff</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>you need to have a unique identifier for the method.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is with objects</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>doSomeStuff    <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>defined in MyData</DIV><DIV>doSomeStuff <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>defined in MyOtherData</DIV><DIV>doSomeStuff<SPAN class="Apple-tab-span" style="white-space:pre">                </SPAN>defined in MySomeOtherData</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The difference is in text only vs objects, but at the end of the day you have </DIV><DIV>a process (the method), you have an input(self), you have a return value(well... the ^value :o) ).</DIV><DIV>I think there are a lot of analogies.</DIV><BR><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Long chains of unary selectors (analog for the</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">discussed operator) are often considered as a code smell because this</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">may put functionality to a wrong place.<BR></FONT></P></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>It's true but I like it that way when I'm prototyping !!! because I can quickly do</DIV><DIV>stuff by reusing methods. </DIV><BR><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"> For instance, if one sees</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">something like "self myOrganization hrDivision currentHRManager</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">suggestApplicant" - he may consider to factor the code fragment to the</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">hrDivision class.</FONT></P> </BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is a good example.  If and only if you have already there</DIV><DIV>all the methods you suggested I would do that way the first time. Quick and easy.</DIV><DIV>Than I would do some testing code. Than I would make it better (factoring) and faster (fixing the algorithm), </DIV><DIV>making sure that I don't not break the tests.</DIV><BR><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">((thingOne isSuch or: [thingTwo isThat]) and: [thing isNotEmpty]) or:</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">[self whatever]) ifTrue: [self doSomething] (assuming evaluating</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">operators don't work here). This example is not concrete of course but</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I recall when I was frustrated having to write similar code.</FONT></P> </BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is my worst frustration too in SmallTalk.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Fabio</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>