in reply to Re^5: Mutator chaining considered harmful
in thread Mutator chaining considered harmful
You missed one giant and important point. If you are familar with the style then its not more difficult to decipher.
It is more difficult to decipher, because it's ambiguous. The ambiguity must be resolved somehow. In the first example, you have to follow the chain of methods and know what type of thing they return. In the 2nd example, the variable name and usage is a big clue that helps resolve the ambiguity.
My point all along has been that it is only hard to read if you aren't used to the style.
It's not more difficult to read, it's more difficult to understand.
Frankly, I' amused you think that's condescending
I say your view is condescending, because rather than accept the fact that someone understands a concept that they don't like, you instead decided they must not understand it fully.
Understanding how method chaining works is easy. Reading code that uses method chaining is not any more difficult than other types of operator or function chaining. The difficulty comes in when you don't know whether a method is returning the object it's working on, or a sub object.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Mutator chaining considered harmful
by eric256 (Parson) on Dec 30, 2004 at 20:32 UTC | |
Re^7: Mutator chaining considered harmful
by DrHyde (Prior) on Jan 04, 2005 at 10:03 UTC | |
Re^7: Mutator chaining considered harmful
by Anonymous Monk on Dec 31, 2004 at 01:33 UTC | |
by revdiablo (Prior) on Dec 31, 2004 at 02:12 UTC | |
by merlyn (Sage) on Dec 31, 2004 at 02:43 UTC | |
by Anonymous Monk on Dec 31, 2004 at 11:02 UTC | |
by ihb (Deacon) on Jan 03, 2005 at 20:37 UTC |