On Sunday 11 June 2017 16:58:23 Marcos Douglas B. Santos wrote: > On Sun, Jun 11, 2017 at 1:29 AM, Martin Schreiber <mse00...@gmail.com> wrote: > >> You need to have a return. If you have a object with a method "exec", > >> eg, why not return the object itself? Just return something. > > > > Why? > > Because you could write a more elegant code. > If you return "self" even in methods that don't need to specify a > return, you can codify using a style more declarative instead of a > procedural style. > > Instead of this: > --- > obj.exec; > obj.foo; > obj.bar; > --- > > We can do this: > --- > obj.exec.foo.bar; > --- > I don't like it. Now one has to check what obj.exec() returns, what obj.exec.foo() returns and so on while reading th code. Another concern is performance.
Martin ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk