in reply to Unlimited chaining (is there a way to detect this?)

Martin Fowler calls this a "fluent interface": http://martinfowler.com/bliki/FluentInterface.html

The idea behind it is that methods that are simply setting object state return the object instance; this can improve readability in many instances, particularly if you align the '->' pointers vertically, and can be used to build constructs that have a natural linguistic flow -- hardly 'dumb' code.

As for detecting it... simply don't write such constructs; the only way you'd be able to programmatically generate such a construct is to pass it to eval, and eval is rarely the right answer.
  • Comment on Re: Unlimited chaining (is there a way to detect this?)

Replies are listed 'Best First'.
Re^2: Unlimited chaining (is there a way to detect this?)
by Burak (Chaplain) on Jan 06, 2008 at 20:56 UTC
    Interesting... I didn't hear that "fluent interface" before :)